diff options
| -rw-r--r-- | releasenotes/notes/rename_version_to_plugin-version-20cfe17530446391.yaml | 10 | ||||
| -rw-r--r-- | saharaclient/osc/v1/cluster_templates.py | 30 | ||||
| -rw-r--r-- | saharaclient/osc/v1/clusters.py | 20 | ||||
| -rw-r--r-- | saharaclient/osc/v1/job_types.py | 12 | ||||
| -rw-r--r-- | saharaclient/osc/v1/node_group_templates.py | 34 | ||||
| -rw-r--r-- | saharaclient/osc/v1/plugins.py | 13 | ||||
| -rw-r--r-- | saharaclient/tests/unit/osc/v1/test_cluster_templates.py | 23 | ||||
| -rw-r--r-- | saharaclient/tests/unit/osc/v1/test_clusters.py | 57 | ||||
| -rw-r--r-- | saharaclient/tests/unit/osc/v1/test_job_types.py | 6 | ||||
| -rw-r--r-- | saharaclient/tests/unit/osc/v1/test_node_group_templates.py | 58 | ||||
| -rw-r--r-- | saharaclient/tests/unit/osc/v1/test_plugins.py | 8 |
11 files changed, 145 insertions, 126 deletions
diff --git a/releasenotes/notes/rename_version_to_plugin-version-20cfe17530446391.yaml b/releasenotes/notes/rename_version_to_plugin-version-20cfe17530446391.yaml new file mode 100644 index 0000000..d8967fd --- /dev/null +++ b/releasenotes/notes/rename_version_to_plugin-version-20cfe17530446391.yaml @@ -0,0 +1,10 @@ +--- +upgrade: + - Option 'version' is replaced by 'plugin-version' option. +fixes: + - Option 'version' is a global option, which is used for getting + the client version. So there were problems with the OpenStack client, + when we specified 'version' of the plugin, but OSC treated + that as a request for getting the current client version. Hence, to fix + this problem, 'version' is replaced by 'plugin-version'. + Related bug 1565775. diff --git a/saharaclient/osc/v1/cluster_templates.py b/saharaclient/osc/v1/cluster_templates.py index 440098f..2396610 100644 --- a/saharaclient/osc/v1/cluster_templates.py +++ b/saharaclient/osc/v1/cluster_templates.py @@ -25,7 +25,7 @@ from oslo_log import log as logging from saharaclient.osc.v1 import utils -CT_FIELDS = ['id', 'name', 'plugin_name', 'version', 'description', +CT_FIELDS = ['id', 'name', 'plugin_name', 'plugin_version', 'description', 'node_groups', 'anti_affinity', 'use_autoconfig', 'is_default', 'is_protected', 'is_public'] @@ -36,7 +36,7 @@ def _format_node_groups_list(node_groups): def _format_ct_output(data): - data['version'] = data.pop('hadoop_version') + data['plugin_version'] = data.pop('hadoop_version') data['node_groups'] = _format_node_groups_list(data['node_groups']) data['anti_affinity'] = osc_utils.format_list(data['anti_affinity']) @@ -59,8 +59,8 @@ def _configure_node_groups(node_groups, client): raise exceptions.CommandError('Node groups with the same plugins ' 'and versions must be specified') - plugin, version = plugins_versions.pop() - return plugin, version, node_groups + plugin, plugin_version = plugins_versions.pop() + return plugin, plugin_version, node_groups class CreateClusterTemplate(show.ShowOne): @@ -180,13 +180,13 @@ class CreateClusterTemplate(show.ShowOne): 'An error occurred when reading ' 'shares from file %s: %s' % (parsed_args.shares, e)) - plugin, version, node_groups = _configure_node_groups( + plugin, plugin_version, node_groups = _configure_node_groups( parsed_args.node_groups, client) data = client.cluster_templates.create( name=parsed_args.name, plugin_name=plugin, - hadoop_version=version, + hadoop_version=plugin_version, description=parsed_args.description, node_groups=node_groups, use_autoconfig=parsed_args.autoconfig, @@ -222,8 +222,8 @@ class ListClusterTemplates(lister.Lister): ) parser.add_argument( - '--version', - metavar="<version>", + '--plugin-version', + metavar="<plugin_version>", help="List cluster templates with specific version of the " "plugin" ) @@ -243,8 +243,8 @@ class ListClusterTemplates(lister.Lister): search_opts = {} if parsed_args.plugin: search_opts['plugin_name'] = parsed_args.plugin - if parsed_args.version: - search_opts['hadoop_version'] = parsed_args.version + if parsed_args.plugin_version: + search_opts['hadoop_version'] = parsed_args.plugin_version data = client.cluster_templates.list(search_opts=search_opts) @@ -255,12 +255,12 @@ class ListClusterTemplates(lister.Lister): columns = ('name', 'id', 'plugin_name', 'hadoop_version', 'node_groups', 'description') column_headers = utils.prepare_column_headers( - columns, {'hadoop_version': 'version'}) + columns, {'hadoop_version': 'plugin_version'}) else: columns = ('name', 'id', 'plugin_name', 'hadoop_version') column_headers = utils.prepare_column_headers( - columns, {'hadoop_version': 'version'}) + columns, {'hadoop_version': 'plugin_version'}) return ( column_headers, @@ -448,9 +448,9 @@ class UpdateClusterTemplate(show.ShowOne): data = client.cluster_templates.update( ct_id, **template).to_dict() else: - plugin, version, node_groups = None, None, None + plugin, plugin_version, node_groups = None, None, None if parsed_args.node_groups: - plugin, version, node_groups = _configure_node_groups( + plugin, plugin_version, node_groups = _configure_node_groups( parsed_args.node_groups, client) configs = None @@ -476,7 +476,7 @@ class UpdateClusterTemplate(show.ShowOne): update_dict = utils.create_dict_from_kwargs( name=parsed_args.name, plugin_name=plugin, - hadoop_version=version, + hadoop_version=plugin_version, description=parsed_args.description, node_groups=node_groups, use_autoconfig=parsed_args.use_autoconfig, diff --git a/saharaclient/osc/v1/clusters.py b/saharaclient/osc/v1/clusters.py index 0f1d8f1..05ec51f 100644 --- a/saharaclient/osc/v1/clusters.py +++ b/saharaclient/osc/v1/clusters.py @@ -27,7 +27,7 @@ from saharaclient.osc.v1 import utils CLUSTER_FIELDS = ["cluster_template_id", "use_autoconfig", "user_keypair_id", "status", "image", "node_groups", "id", - "anti_affinity", "version", "name", "is_transient", + "anti_affinity", "plugin_version", "name", "is_transient", "is_protected", "description", "is_public", "neutron_management_network", "plugin_name"] @@ -38,7 +38,7 @@ def _format_node_groups_list(node_groups): def _format_cluster_output(data): - data['version'] = data.pop('hadoop_version') + data['plugin_version'] = data.pop('hadoop_version') data['image'] = data.pop('default_image_id') data['node_groups'] = _format_node_groups_list(data['node_groups']) data['anti_affinity'] = osc_utils.format_list(data['anti_affinity']) @@ -171,7 +171,7 @@ class CreateCluster(show.ShowOne): 'should be specified or json template should be provided ' 'with --json argument') - plugin, version, template_id = _get_plugin_version( + plugin, plugin_version, template_id = _get_plugin_version( parsed_args.cluster_template, client) image_id = utils.get_resource_id(client.images, parsed_args.image) @@ -183,7 +183,7 @@ class CreateCluster(show.ShowOne): data = client.clusters.create( name=parsed_args.name, plugin_name=plugin, - hadoop_version=version, + hadoop_version=plugin_version, cluster_template_id=template_id, default_image_id=image_id, description=parsed_args.description, @@ -245,8 +245,8 @@ class ListClusters(lister.Lister): ) parser.add_argument( - '--version', - metavar="<version>", + '--plugin-version', + metavar="<plugin_version>", help="List clusters with specific version of the " "plugin" ) @@ -265,8 +265,8 @@ class ListClusters(lister.Lister): search_opts = {} if parsed_args.plugin: search_opts['plugin_name'] = parsed_args.plugin - if parsed_args.version: - search_opts['hadoop_version'] = parsed_args.version + if parsed_args.plugin_version: + search_opts['hadoop_version'] = parsed_args.plugin_version data = client.clusters.list(search_opts=search_opts) @@ -277,13 +277,13 @@ class ListClusters(lister.Lister): columns = ('name', 'id', 'plugin_name', 'hadoop_version', 'status', 'description', 'default_image_id') column_headers = utils.prepare_column_headers( - columns, {'hadoop_version': 'version', + columns, {'hadoop_version': 'plugin_version', 'default_image_id': 'image'}) else: columns = ('name', 'id', 'plugin_name', 'hadoop_version', 'status') column_headers = utils.prepare_column_headers( - columns, {'hadoop_version': 'version', + columns, {'hadoop_version': 'plugin_version', 'default_image_id': 'image'}) return ( column_headers, diff --git a/saharaclient/osc/v1/job_types.py b/saharaclient/osc/v1/job_types.py index 4f98791..08f4013 100644 --- a/saharaclient/osc/v1/job_types.py +++ b/saharaclient/osc/v1/job_types.py @@ -46,8 +46,8 @@ class ListJobTypes(lister.Lister): help="Get only job types supported by this plugin" ) parser.add_argument( - '--version', - metavar="<version>", + '--plugin-version', + metavar="<plugin_version>", help="Get only job types supported by specific version of the " "plugin. This parameter will be taken into account only if " "plugin is provided" @@ -64,11 +64,11 @@ class ListJobTypes(lister.Lister): search_opts['type'] = parsed_args.type if parsed_args.plugin: search_opts['plugin'] = parsed_args.plugin - if parsed_args.version: - search_opts['version'] = parsed_args.version - elif parsed_args.version: + if parsed_args.plugin_version: + search_opts['plugin_version'] = parsed_args.plugin_version + elif parsed_args.plugin_version: raise exceptions.CommandError( - '--version argument should be specified with --plugin ' + '--plugin-version argument should be specified with --plugin ' 'argument') data = client.job_types.list(search_opts=search_opts) diff --git a/saharaclient/osc/v1/node_group_templates.py b/saharaclient/osc/v1/node_group_templates.py index a24253d..1d08097 100644 --- a/saharaclient/osc/v1/node_group_templates.py +++ b/saharaclient/osc/v1/node_group_templates.py @@ -25,7 +25,7 @@ from oslo_log import log as logging from saharaclient.osc.v1 import utils -NGT_FIELDS = ['id', 'name', 'plugin_name', 'version', 'node_processes', +NGT_FIELDS = ['id', 'name', 'plugin_name', 'plugin_version', 'node_processes', 'description', 'auto_security_group', 'security_groups', 'availability_zone', 'flavor_id', 'floating_ip_pool', 'volumes_per_node', 'volumes_size', @@ -36,7 +36,7 @@ NGT_FIELDS = ['id', 'name', 'plugin_name', 'version', 'node_processes', def _format_ngt_output(data): data['node_processes'] = osc_utils.format_list(data['node_processes']) - data['version'] = data.pop('hadoop_version') + data['plugin_version'] = data.pop('hadoop_version') if data['volumes_per_node'] == 0: del data['volume_local_to_instance'] del data['volume_mount_prefix'] @@ -65,8 +65,8 @@ class CreateNodeGroupTemplate(show.ShowOne): help="Name of the plugin [REQUIRED if JSON is not provided]" ) parser.add_argument( - '--version', - metavar="<version>", + '--plugin-version', + metavar="<plugin_version>", help="Version of the plugin [REQUIRED if JSON is not provided]" ) parser.add_argument( @@ -215,11 +215,11 @@ class CreateNodeGroupTemplate(show.ShowOne): data = client.node_group_templates.create(**template).to_dict() else: if (not parsed_args.name or not parsed_args.plugin or - not parsed_args.version or not parsed_args.flavor or + not parsed_args.plugin_version or not parsed_args.flavor or not parsed_args.processes): raise exceptions.CommandError( - 'At least --name, --plugin, --version, --processes, ' - '--flavor arguments should be specified or json template ' + 'At least --name, --plugin, --plugin-version, --processes,' + ' --flavor arguments should be specified or json template ' 'should be provided with --json argument') configs = None @@ -249,7 +249,7 @@ class CreateNodeGroupTemplate(show.ShowOne): data = client.node_group_templates.create( name=parsed_args.name, plugin_name=parsed_args.plugin, - hadoop_version=parsed_args.version, + hadoop_version=parsed_args.plugin_version, flavor_id=flavor_id, description=parsed_args.description, volumes_per_node=parsed_args.volumes_per_node, @@ -296,8 +296,8 @@ class ListNodeGroupTemplates(lister.Lister): ) parser.add_argument( - '--version', - metavar="<version>", + '--plugin-version', + metavar="<plugin_version>", help="List node group templates with specific version of the " "plugin" ) @@ -317,8 +317,8 @@ class ListNodeGroupTemplates(lister.Lister): search_opts = {} if parsed_args.plugin: search_opts['plugin_name'] = parsed_args.plugin - if parsed_args.version: - search_opts['hadoop_version'] = parsed_args.version + if parsed_args.plugin_version: + search_opts['hadoop_version'] = parsed_args.plugin_version data = client.node_group_templates.list(search_opts=search_opts) @@ -329,12 +329,12 @@ class ListNodeGroupTemplates(lister.Lister): columns = ('name', 'id', 'plugin_name', 'hadoop_version', 'node_processes', 'description') column_headers = utils.prepare_column_headers( - columns, {'hadoop_version': 'version'}) + columns, {'hadoop_version': 'plugin_version'}) else: columns = ('name', 'id', 'plugin_name', 'hadoop_version') column_headers = utils.prepare_column_headers( - columns, {'hadoop_version': 'version'}) + columns, {'hadoop_version': 'plugin_version'}) return ( column_headers, @@ -430,8 +430,8 @@ class UpdateNodeGroupTemplate(show.ShowOne): help="Name of the plugin" ) parser.add_argument( - '--version', - metavar="<version>", + '--plugin-version', + metavar="<plugin_version>", help="Version of the plugin" ) parser.add_argument( @@ -663,7 +663,7 @@ class UpdateNodeGroupTemplate(show.ShowOne): update_dict = utils.create_dict_from_kwargs( name=parsed_args.name, plugin_name=parsed_args.plugin, - hadoop_version=parsed_args.version, + hadoop_version=parsed_args.plugin_version, flavor_id=flavor_id, description=parsed_args.description, volumes_per_node=parsed_args.volumes_per_node, diff --git a/saharaclient/osc/v1/plugins.py b/saharaclient/osc/v1/plugins.py index e616a35..21f5726 100644 --- a/saharaclient/osc/v1/plugins.py +++ b/saharaclient/osc/v1/plugins.py @@ -80,7 +80,8 @@ class ShowPlugin(show.ShowOne): help="Name of the plugin to display", ) parser.add_argument( - "--version", + "--plugin-version", + metavar="<plugin_version>", help='Version of the plugin to display' ) @@ -90,9 +91,9 @@ class ShowPlugin(show.ShowOne): self.log.debug("take_action(%s)" % parsed_args) client = self.app.client_manager.data_processing - if parsed_args.version: + if parsed_args.plugin_version: data = client.plugins.get_version_details( - parsed_args.plugin, parsed_args.version).to_dict() + parsed_args.plugin, parsed_args.plugin_version).to_dict() processes = data.pop('node_processes') for k, v in processes.items(): @@ -129,8 +130,8 @@ class GetPluginConfigs(command.Command): help="Name of the plugin to provide config information about", ) parser.add_argument( - "version", - metavar="<version>", + "plugin_version", + metavar="<plugin_version>", help="Version of the plugin to provide config information about", ) parser.add_argument( @@ -148,7 +149,7 @@ class GetPluginConfigs(command.Command): parsed_args.file = parsed_args.plugin data = client.plugins.get_version_details( - parsed_args.plugin, parsed_args.version).to_dict() + parsed_args.plugin, parsed_args.plugin_version).to_dict() if path.exists(parsed_args.file): self.log.error('File "%s" already exists. Chose another one with ' diff --git a/saharaclient/tests/unit/osc/v1/test_cluster_templates.py b/saharaclient/tests/unit/osc/v1/test_cluster_templates.py index d98e89b..7bbaea7 100644 --- a/saharaclient/tests/unit/osc/v1/test_cluster_templates.py +++ b/saharaclient/tests/unit/osc/v1/test_cluster_templates.py @@ -113,13 +113,13 @@ class TestCreateClusterTemplate(TestClusterTemplates): # Check that columns are correct expected_columns = ('Anti affinity', 'Description', 'Id', 'Is default', 'Is protected', 'Is public', 'Name', 'Node groups', - 'Plugin name', 'Use autoconfig', 'Version') + 'Plugin name', 'Plugin version', 'Use autoconfig') self.assertEqual(expected_columns, columns) # Check that data is correct expected_data = ('', 'Cluster template for tests', '0647061f-ab98-4c89-84e0-30738ea55750', False, False, - False, 'template', 'fakeng:2', 'fake', True, '0.1') + False, 'template', 'fakeng:2', 'fake', '0.1', True) self.assertEqual(expected_data, data) @@ -141,7 +141,7 @@ class TestListClusterTemplates(TestClusterTemplates): columns, data = self.cmd.take_action(parsed_args) # Check that columns are correct - expected_columns = ['Name', 'Id', 'Plugin name', 'Version'] + expected_columns = ['Name', 'Id', 'Plugin name', 'Plugin version'] self.assertEqual(expected_columns, columns) # Check that data is correct @@ -158,7 +158,7 @@ class TestListClusterTemplates(TestClusterTemplates): columns, data = self.cmd.take_action(parsed_args) # Check that columns are correct - expected_columns = ['Name', 'Id', 'Plugin name', 'Version', + expected_columns = ['Name', 'Id', 'Plugin name', 'Plugin version', 'Node groups', 'Description'] self.assertEqual(expected_columns, columns) @@ -169,8 +169,9 @@ class TestListClusterTemplates(TestClusterTemplates): self.assertEqual(expected_data, list(data)) def test_ct_list_extra_search_opts(self): - arglist = ['--plugin', 'fake', '--version', '0.1', '--name', 'templ'] - verifylist = [('plugin', 'fake'), ('version', '0.1'), + arglist = ['--plugin', 'fake', '--plugin-version', '0.1', '--name', + 'templ'] + verifylist = [('plugin', 'fake'), ('plugin_version', '0.1'), ('name', 'templ')] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -178,7 +179,7 @@ class TestListClusterTemplates(TestClusterTemplates): columns, data = self.cmd.take_action(parsed_args) # Check that columns are correct - expected_columns = ['Name', 'Id', 'Plugin name', 'Version'] + expected_columns = ['Name', 'Id', 'Plugin name', 'Plugin version'] self.assertEqual(expected_columns, columns) # Check that data is correct @@ -210,14 +211,14 @@ class TestShowClusterTemplate(TestClusterTemplates): # Check that columns are correct expected_columns = ('Anti affinity', 'Description', 'Id', 'Is default', 'Is protected', 'Is public', 'Name', 'Node groups', - 'Plugin name', 'Use autoconfig', 'Version') + 'Plugin name', 'Plugin version', 'Use autoconfig') self.assertEqual(expected_columns, columns) # Check that data is correct expected_data = ( '', 'Cluster template for tests', '0647061f-ab98-4c89-84e0-30738ea55750', False, False, False, - 'template', 'fakeng:2', 'fake', True, '0.1') + 'template', 'fakeng:2', 'fake', '0.1', True) self.assertEqual(expected_data, data) @@ -304,13 +305,13 @@ class TestUpdateClusterTemplate(TestClusterTemplates): # Check that columns are correct expected_columns = ('Anti affinity', 'Description', 'Id', 'Is default', 'Is protected', 'Is public', 'Name', 'Node groups', - 'Plugin name', 'Use autoconfig', 'Version') + 'Plugin name', 'Plugin version', 'Use autoconfig') self.assertEqual(expected_columns, columns) # Check that data is correct expected_data = ('', 'Cluster template for tests', '0647061f-ab98-4c89-84e0-30738ea55750', False, False, - False, 'template', 'fakeng:2', 'fake', True, '0.1') + False, 'template', 'fakeng:2', 'fake', '0.1', True) self.assertEqual(expected_data, data) def test_ct_update_private_unprotected(self): diff --git a/saharaclient/tests/unit/osc/v1/test_clusters.py b/saharaclient/tests/unit/osc/v1/test_clusters.py index 46027d8..67c6b8a 100644 --- a/saharaclient/tests/unit/osc/v1/test_clusters.py +++ b/saharaclient/tests/unit/osc/v1/test_clusters.py @@ -158,15 +158,15 @@ class TestCreateCluster(TestClusters): 'Description', 'Id', 'Image', 'Is protected', 'Is public', 'Name', 'Neutron management network', 'Node groups', - 'Plugin name', 'Status', 'Use autoconfig', - 'User keypair id', 'Version') + 'Plugin name', 'Plugin version', 'Status', + 'Use autoconfig', 'User keypair id') self.assertEqual(expected_columns, columns) # Check that data is correct expected_data = ('', 'ct_id', 'Cluster template for tests', 'cluster_id', 'img_id', False, False, 'fake', - 'net_id', 'fakeng:2', 'fake', 'Active', True, 'test', - '0.1') + 'net_id', 'fakeng:2', 'fake', '0.1', 'Active', True, + 'test') self.assertEqual(expected_data, data) def test_cluster_create_with_count(self): @@ -219,7 +219,8 @@ class TestListClusters(TestClusters): columns, data = self.cmd.take_action(parsed_args) # Check that columns are correct - expected_columns = ['Name', 'Id', 'Plugin name', 'Version', 'Status'] + expected_columns = ['Name', 'Id', 'Plugin name', 'Plugin version', + 'Status'] self.assertEqual(expected_columns, columns) # Check that data is correct @@ -235,8 +236,8 @@ class TestListClusters(TestClusters): columns, data = self.cmd.take_action(parsed_args) # Check that columns are correct - expected_columns = ['Name', 'Id', 'Plugin name', 'Version', 'Status', - 'Description', 'Image'] + expected_columns = ['Name', 'Id', 'Plugin name', 'Plugin version', + 'Status', 'Description', 'Image'] self.assertEqual(expected_columns, columns) # Check that data is correct @@ -245,8 +246,9 @@ class TestListClusters(TestClusters): self.assertEqual(expected_data, list(data)) def test_clusters_list_extra_search_opts(self): - arglist = ['--plugin', 'fake', '--version', '0.1', '--name', 'fake'] - verifylist = [('plugin', 'fake'), ('version', '0.1'), + arglist = ['--plugin', 'fake', '--plugin-version', '0.1', '--name', + 'fake'] + verifylist = [('plugin', 'fake'), ('plugin_version', '0.1'), ('name', 'fake')] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -254,7 +256,8 @@ class TestListClusters(TestClusters): columns, data = self.cmd.take_action(parsed_args) # Check that columns are correct - expected_columns = ['Name', 'Id', 'Plugin name', 'Version', 'Status'] + expected_columns = ['Name', 'Id', 'Plugin name', 'Plugin version', + 'Status'] self.assertEqual(expected_columns, columns) # Check that data is correct @@ -287,15 +290,15 @@ class TestShowCluster(TestClusters): 'Description', 'Id', 'Image', 'Is protected', 'Is public', 'Name', 'Neutron management network', 'Node groups', - 'Plugin name', 'Status', 'Use autoconfig', - 'User keypair id', 'Version') + 'Plugin name', 'Plugin version', 'Status', + 'Use autoconfig', 'User keypair id') self.assertEqual(expected_columns, columns) # Check that data is correct expected_data = ('', 'ct_id', 'Cluster template for tests', 'cluster_id', 'img_id', False, False, 'fake', - 'net_id', 'fakeng:2', 'fake', 'Active', True, 'test', - '0.1') + 'net_id', 'fakeng:2', 'fake', '0.1', 'Active', True, + 'test') self.assertEqual(expected_data, data) def test_cluster_show_verification(self): @@ -314,16 +317,16 @@ class TestShowCluster(TestClusters): 'Description', 'Health check (some check)', 'Id', 'Image', 'Is protected', 'Is public', 'Name', 'Neutron management network', 'Node groups', - 'Plugin name', 'Status', 'Use autoconfig', - 'User keypair id', 'Verification status', - 'Version') + 'Plugin name', 'Plugin version', 'Status', + 'Use autoconfig', 'User keypair id', + 'Verification status') self.assertEqual(expected_columns, columns) # Check that data is correct expected_data = ('', 'ct_id', 'Cluster template for tests', 'GREEN', 'cluster_id', 'img_id', False, False, 'fake', - 'net_id', 'fakeng:2', 'fake', 'Active', True, 'test', - 'GREEN', '0.1') + 'net_id', 'fakeng:2', 'fake', '0.1', 'Active', True, + 'test', 'GREEN') self.assertEqual(expected_data, data) @@ -400,15 +403,15 @@ class TestUpdateCluster(TestClusters): 'Description', 'Id', 'Image', 'Is protected', 'Is public', 'Name', 'Neutron management network', 'Node groups', - 'Plugin name', 'Status', 'Use autoconfig', - 'User keypair id', 'Version') + 'Plugin name', 'Plugin version', 'Status', + 'Use autoconfig', 'User keypair id') self.assertEqual(expected_columns, columns) # Check that data is correct expected_data = ('', 'ct_id', 'Cluster template for tests', 'cluster_id', 'img_id', False, False, 'fake', - 'net_id', 'fakeng:2', 'fake', 'Active', True, 'test', - '0.1') + 'net_id', 'fakeng:2', 'fake', '0.1', 'Active', True, + 'test') self.assertEqual(expected_data, data) def test_cluster_update_private_unprotected(self): @@ -469,15 +472,15 @@ class TestScaleCluster(TestClusters): 'Description', 'Id', 'Image', 'Is protected', 'Is public', 'Name', 'Neutron management network', 'Node groups', - 'Plugin name', 'Status', 'Use autoconfig', - 'User keypair id', 'Version') + 'Plugin name', 'Plugin version', 'Status', + 'Use autoconfig', 'User keypair id') self.assertEqual(expected_columns, columns) # Check that data is correct expected_data = ('', 'ct_id', 'Cluster template for tests', 'cluster_id', 'img_id', False, False, 'fake', - 'net_id', 'fakeng:2', 'fake', 'Active', True, 'test', - '0.1') + 'net_id', 'fakeng:2', 'fake', '0.1', 'Active', True, + 'test') self.assertEqual(expected_data, data) def test_cluster_scale_add_ng(self): diff --git a/saharaclient/tests/unit/osc/v1/test_job_types.py b/saharaclient/tests/unit/osc/v1/test_job_types.py index ed2c1bb..d087b91 100644 --- a/saharaclient/tests/unit/osc/v1/test_job_types.py +++ b/saharaclient/tests/unit/osc/v1/test_job_types.py @@ -75,8 +75,10 @@ class TestListJobTemplates(TestJobTypes): self.assertEqual(expected_data, list(data)) def test_job_types_list_extra_search_opts(self): - arglist = ['--type', 'Pig', '--plugin', 'fake', '--version', '0.1'] - verifylist = [('type', 'Pig'), ('plugin', 'fake'), ('version', '0.1')] + arglist = ['--type', 'Pig', '--plugin', 'fake', '--plugin-version', + '0.1'] + verifylist = [('type', 'Pig'), ('plugin', 'fake'), + ('plugin_version', '0.1')] parsed_args = self.check_parser(self.cmd, arglist, verifylist) 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 c67dcc0..3c75b77 100644 --- a/saharaclient/tests/unit/osc/v1/test_node_group_templates.py +++ b/saharaclient/tests/unit/osc/v1/test_node_group_templates.py @@ -77,11 +77,11 @@ class TestCreateNodeGroupTemplate(TestNodeGroupTemplates): self.cmd = osc_ngt.CreateNodeGroupTemplate(self.app, None) def test_ngt_create_minimum_options(self): - arglist = ['--name', 'template', '--plugin', 'fake', '--version', - '0.1', '--processes', 'namenode', 'tasktracker', - '--flavor', 'flavor_id'] + arglist = ['--name', 'template', '--plugin', 'fake', + '--plugin-version', '0.1', '--processes', 'namenode', + 'tasktracker', '--flavor', 'flavor_id'] verifylist = [('name', 'template'), ('plugin', 'fake'), - ('version', '0.1'), ('flavor', 'flavor_id'), + ('plugin_version', '0.1'), ('flavor', 'flavor_id'), ('processes', ['namenode', 'tasktracker'])] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -102,11 +102,12 @@ class TestCreateNodeGroupTemplate(TestNodeGroupTemplates): node_configs=None) def test_ngt_create_all_options(self): - arglist = ['--name', 'template', '--plugin', 'fake', '--version', - '0.1', '--processes', 'namenode', 'tasktracker', - '--security-groups', 'secgr', '--auto-security-group', - '--availability-zone', 'av_zone', '--flavor', 'flavor_id', - '--floating-ip-pool', 'floating_pool', '--volumes-per-node', + arglist = ['--name', 'template', '--plugin', 'fake', + '--plugin-version', '0.1', '--processes', 'namenode', + 'tasktracker', '--security-groups', 'secgr', + '--auto-security-group', '--availability-zone', 'av_zone', + '--flavor', 'flavor_id', '--floating-ip-pool', + 'floating_pool', '--volumes-per-node', '2', '--volumes-size', '2', '--volumes-type', 'type', '--volumes-availability-zone', 'vavzone', '--volumes-mount-prefix', '/volume/asd', @@ -115,7 +116,7 @@ class TestCreateNodeGroupTemplate(TestNodeGroupTemplates): '--protected'] verifylist = [('name', 'template'), ('plugin', 'fake'), - ('version', '0.1'), + ('plugin_version', '0.1'), ('processes', ['namenode', 'tasktracker']), ('security_groups', ['secgr']), ('auto_security_group', True), @@ -151,8 +152,8 @@ class TestCreateNodeGroupTemplate(TestNodeGroupTemplates): 'Auto security group', 'Availability zone', 'Description', 'Flavor id', 'Floating ip pool', 'Id', 'Is default', 'Is protected', 'Is proxy gateway', 'Is public', 'Name', - 'Node processes', 'Plugin name', 'Security groups', - 'Use autoconfig', 'Version', 'Volume local to instance', + 'Node processes', 'Plugin name', 'Plugin version', + 'Security groups', 'Use autoconfig', 'Volume local to instance', 'Volume mount prefix', 'Volume type', 'Volumes availability zone', 'Volumes per node', 'Volumes size') self.assertEqual(expected_columns, columns) @@ -161,8 +162,8 @@ class TestCreateNodeGroupTemplate(TestNodeGroupTemplates): expected_data = ( True, 'av_zone', 'description', 'flavor_id', 'floating_pool', 'ng_id', False, False, False, - True, 'template', 'namenode, tasktracker', 'fake', None, True, - '0.1', False, '/volumes/disk', None, None, 2, 2) + True, 'template', 'namenode, tasktracker', 'fake', '0.1', + None, True, False, '/volumes/disk', None, None, 2, 2) self.assertEqual(expected_data, data) @@ -184,7 +185,7 @@ class TestListNodeGroupTemplates(TestNodeGroupTemplates): columns, data = self.cmd.take_action(parsed_args) # Check that columns are correct - expected_columns = ['Name', 'Id', 'Plugin name', 'Version'] + expected_columns = ['Name', 'Id', 'Plugin name', 'Plugin version'] self.assertEqual(expected_columns, columns) # Check that data is correct @@ -200,7 +201,7 @@ class TestListNodeGroupTemplates(TestNodeGroupTemplates): columns, data = self.cmd.take_action(parsed_args) # Check that columns are correct - expected_columns = ['Name', 'Id', 'Plugin name', 'Version', + expected_columns = ['Name', 'Id', 'Plugin name', 'Plugin version', 'Node processes', 'Description'] self.assertEqual(expected_columns, columns) @@ -210,8 +211,9 @@ class TestListNodeGroupTemplates(TestNodeGroupTemplates): self.assertEqual(expected_data, list(data)) def test_ngt_list_extra_search_opts(self): - arglist = ['--plugin', 'fake', '--version', '0.1', '--name', 'templ'] - verifylist = [('plugin', 'fake'), ('version', '0.1'), + arglist = ['--plugin', 'fake', '--plugin-version', '0.1', '--name', + 'templ'] + verifylist = [('plugin', 'fake'), ('plugin_version', '0.1'), ('name', 'templ')] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -219,7 +221,7 @@ class TestListNodeGroupTemplates(TestNodeGroupTemplates): columns, data = self.cmd.take_action(parsed_args) # Check that columns are correct - expected_columns = ['Name', 'Id', 'Plugin name', 'Version'] + expected_columns = ['Name', 'Id', 'Plugin name', 'Plugin version'] self.assertEqual(expected_columns, columns) # Check that data is correct @@ -252,8 +254,8 @@ class TestShowNodeGroupTemplate(TestNodeGroupTemplates): 'Auto security group', 'Availability zone', 'Description', 'Flavor id', 'Floating ip pool', 'Id', 'Is default', 'Is protected', 'Is proxy gateway', 'Is public', 'Name', - 'Node processes', 'Plugin name', 'Security groups', - 'Use autoconfig', 'Version', 'Volume local to instance', + 'Node processes', 'Plugin name', 'Plugin version', + 'Security groups', 'Use autoconfig', 'Volume local to instance', 'Volume mount prefix', 'Volume type', 'Volumes availability zone', 'Volumes per node', 'Volumes size') self.assertEqual(expected_columns, columns) @@ -262,7 +264,7 @@ class TestShowNodeGroupTemplate(TestNodeGroupTemplates): expected_data = ( True, 'av_zone', 'description', 'flavor_id', 'floating_pool', 'ng_id', False, False, False, True, 'template', - 'namenode, tasktracker', 'fake', None, True, '0.1', False, + 'namenode, tasktracker', 'fake', '0.1', None, True, False, '/volumes/disk', None, None, 2, 2) self.assertEqual(expected_data, data) @@ -324,7 +326,7 @@ class TestUpdateNodeGroupTemplate(TestNodeGroupTemplates): def test_ngt_update_all_options(self): arglist = ['template', '--name', 'template', '--plugin', 'fake', - '--version', '0.1', '--processes', 'namenode', + '--plugin-version', '0.1', '--processes', 'namenode', 'tasktracker', '--security-groups', 'secgr', '--auto-security-group-enable', '--availability-zone', 'av_zone', '--flavor', 'flavor_id', @@ -338,7 +340,7 @@ class TestUpdateNodeGroupTemplate(TestNodeGroupTemplates): verifylist = [('node_group_template', 'template'), ('name', 'template'), ('plugin', 'fake'), - ('version', '0.1'), + ('plugin_version', '0.1'), ('processes', ['namenode', 'tasktracker']), ('security_groups', ['secgr']), ('use_auto_security_group', True), @@ -376,8 +378,8 @@ class TestUpdateNodeGroupTemplate(TestNodeGroupTemplates): 'Auto security group', 'Availability zone', 'Description', 'Flavor id', 'Floating ip pool', 'Id', 'Is default', 'Is protected', 'Is proxy gateway', 'Is public', 'Name', - 'Node processes', 'Plugin name', 'Security groups', - 'Use autoconfig', 'Version', 'Volume local to instance', + 'Node processes', 'Plugin name', 'Plugin version', + 'Security groups', 'Use autoconfig', 'Volume local to instance', 'Volume mount prefix', 'Volume type', 'Volumes availability zone', 'Volumes per node', 'Volumes size') self.assertEqual(expected_columns, columns) @@ -386,8 +388,8 @@ class TestUpdateNodeGroupTemplate(TestNodeGroupTemplates): expected_data = ( True, 'av_zone', 'description', 'flavor_id', 'floating_pool', 'ng_id', False, False, False, True, 'template', - 'namenode, tasktracker', 'fake', None, True, - '0.1', False, '/volumes/disk', None, None, 2, 2) + 'namenode, tasktracker', 'fake', '0.1', None, True, + False, '/volumes/disk', None, None, 2, 2) self.assertEqual(expected_data, data) def test_ngt_update_private_unprotected(self): diff --git a/saharaclient/tests/unit/osc/v1/test_plugins.py b/saharaclient/tests/unit/osc/v1/test_plugins.py index 05f9e38..f340406 100644 --- a/saharaclient/tests/unit/osc/v1/test_plugins.py +++ b/saharaclient/tests/unit/osc/v1/test_plugins.py @@ -112,8 +112,8 @@ class TestShowPlugin(TestPlugins): self.assertEqual(expected_data, data) def test_plugin_version_show(self): - arglist = ['fake', '--version', '0.1'] - verifylist = [('plugin', 'fake'), ('version', '0.1')] + arglist = ['fake', '--plugin-version', '0.1'] + verifylist = [('plugin', 'fake'), ('plugin_version', '0.1')] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -149,7 +149,7 @@ class TestGetPluginConfigs(TestPlugins): m_open = mock.mock_open() with mock.patch('six.moves.builtins.open', m_open, create=True): arglist = ['fake', '0.1'] - verifylist = [('plugin', 'fake'), ('version', '0.1')] + verifylist = [('plugin', 'fake'), ('plugin_version', '0.1')] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -171,7 +171,7 @@ class TestGetPluginConfigs(TestPlugins): m_open = mock.mock_open() with mock.patch('six.moves.builtins.open', m_open): arglist = ['fake', '0.1', '--file', 'testfile'] - verifylist = [('plugin', 'fake'), ('version', '0.1'), + verifylist = [('plugin', 'fake'), ('plugin_version', '0.1'), ('file', 'testfile')] parsed_args = self.check_parser(self.cmd, arglist, verifylist) |
