From 4ac9f74fae84db8cc33206ab56a43a2538880c7f Mon Sep 17 00:00:00 2001 From: Telles Nobrega Date: Mon, 14 Aug 2017 16:14:01 -0300 Subject: [PATCH] Adding volume_mount_prefix parameter Adding this parameter to create and update on the CLI Change-Id: I792b4e7f0182e042086555f612d188d6dea03cf1 Closes-bug: #1630563 --- saharaclient/osc/v1/node_group_templates.py | 8 ++++++-- .../tests/unit/osc/v1/test_node_group_templates.py | 7 ++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/saharaclient/osc/v1/node_group_templates.py b/saharaclient/osc/v1/node_group_templates.py index d4c1342b..bb9d9a37 100644 --- a/saharaclient/osc/v1/node_group_templates.py +++ b/saharaclient/osc/v1/node_group_templates.py @@ -265,7 +265,9 @@ class CreateNodeGroupTemplate(command.ShowOne): is_protected=parsed_args.protected, node_configs=configs, shares=shares, - volumes_availability_zone=parsed_args.volumes_availability_zone + volumes_availability_zone=( + parsed_args.volumes_availability_zone), + volume_mount_prefix=parsed_args.volumes_mount_prefix ).to_dict() _format_ngt_output(data) @@ -679,7 +681,9 @@ class UpdateNodeGroupTemplate(command.ShowOne): is_protected=parsed_args.is_protected, node_configs=configs, shares=shares, - volumes_availability_zone=parsed_args.volumes_availability_zone + volumes_availability_zone=( + parsed_args.volumes_availability_zone), + volume_mount_prefix=parsed_args.volumes_mount_prefix ) data = client.node_group_templates.update( diff --git a/saharaclient/tests/unit/osc/v1/test_node_group_templates.py b/saharaclient/tests/unit/osc/v1/test_node_group_templates.py index 0832163b..b23a4e43 100644 --- a/saharaclient/tests/unit/osc/v1/test_node_group_templates.py +++ b/saharaclient/tests/unit/osc/v1/test_node_group_templates.py @@ -98,7 +98,7 @@ class TestCreateNodeGroupTemplate(TestNodeGroupTemplates): volume_local_to_instance=False, volume_type=None, volumes_availability_zone=None, volumes_per_node=None, volumes_size=None, shares=None, - node_configs=None) + node_configs=None, volume_mount_prefix=None) def test_ngt_create_all_options(self): arglist = ['--name', 'template', '--plugin', 'fake', @@ -144,7 +144,8 @@ class TestCreateNodeGroupTemplate(TestNodeGroupTemplates): plugin_name='fake', security_groups=['secgr'], use_autoconfig=True, volume_local_to_instance=True, volume_type='type', volumes_availability_zone='vavzone', volumes_per_node=2, - volumes_size=2, shares=None, node_configs=None) + volumes_size=2, shares=None, node_configs=None, + volume_mount_prefix='/volume/asd') # Check that columns are correct expected_columns = ( @@ -370,7 +371,7 @@ class TestUpdateNodeGroupTemplate(TestNodeGroupTemplates): plugin_name='fake', security_groups=['secgr'], use_autoconfig=True, volume_local_to_instance=True, volume_type='type', volumes_availability_zone='vavzone', volumes_per_node=2, - volumes_size=2) + volumes_size=2, volume_mount_prefix='/volume/asd') # Check that columns are correct expected_columns = (