From f54c307addac05fb8d929f42371a4336ad86ed4c Mon Sep 17 00:00:00 2001 From: Ilya Kutukov Date: Mon, 30 Nov 2015 16:42:40 +0300 Subject: [PATCH] equipment plugin group added Related-Bug: 1520287 Related to blueprint external-dashboard-links-support-in-nailgun Change-Id: I8fda5cdee6cf5af56b879e21925950c89e8e8f5f --- CHANGELOG.md | 5 ++- examples/fuel_plugin_example_v4/metadata.yaml | 3 +- .../v4/plugin_data/metadata.yaml.mako | 3 +- .../tests/test_validator_v4.py | 42 +++++++++++++++++++ fuel_plugin_builder/validators/schemas/v4.py | 1 + 5 files changed, 50 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e43b182..ee6337e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 4.0.0 (2015-12-14) +## 4.0.0 (unreleased) New package version "4.0.0" includes the following features: @@ -8,6 +8,7 @@ New package version "4.0.0" includes the following features: plugin on previously deployed environments. - Plugin can specify settings group using "group" field in metadata in environment_config.yaml file. +- New group `equipment` added to groups list in `metadata.yaml`. Bugfixes: @@ -120,4 +121,4 @@ Initial public release - Plugin create - Plugin build -- Plugin check +- Plugin check \ No newline at end of file diff --git a/examples/fuel_plugin_example_v4/metadata.yaml b/examples/fuel_plugin_example_v4/metadata.yaml index df2ab6d..550f59f 100644 --- a/examples/fuel_plugin_example_v4/metadata.yaml +++ b/examples/fuel_plugin_example_v4/metadata.yaml @@ -15,7 +15,8 @@ authors: ['Specify author or company name'] # A link to the plugin's page homepage: 'https://github.com/openstack/fuel-plugins' # Specify a group which your plugin implements, possible options: -# network, storage, storage::cinder, storage::glance, hypervisor +# network, storage, storage::cinder, storage::glance, hypervisor, +# equipment groups: [] # Change `false` to `true` if the plugin can be installed in the environment # after the deployment. diff --git a/fuel_plugin_builder/templates/v4/plugin_data/metadata.yaml.mako b/fuel_plugin_builder/templates/v4/plugin_data/metadata.yaml.mako index e003c20..ded7ac7 100644 --- a/fuel_plugin_builder/templates/v4/plugin_data/metadata.yaml.mako +++ b/fuel_plugin_builder/templates/v4/plugin_data/metadata.yaml.mako @@ -15,7 +15,8 @@ authors: ['Specify author or company name'] # A link to the plugin's page homepage: 'https://github.com/openstack/fuel-plugins' # Specify a group which your plugin implements, possible options: -# network, storage, storage::cinder, storage::glance, hypervisor +# network, storage, storage::cinder, storage::glance, hypervisor, +# equipment groups: [] # Change `false` to `true` if the plugin can be installed in the environment # after the deployment. diff --git a/fuel_plugin_builder/tests/test_validator_v4.py b/fuel_plugin_builder/tests/test_validator_v4.py index 2714e06..5ed44bd 100644 --- a/fuel_plugin_builder/tests/test_validator_v4.py +++ b/fuel_plugin_builder/tests/test_validator_v4.py @@ -28,6 +28,31 @@ class TestValidatorV4(TestValidatorV3): validator_class = ValidatorV4 schema_class = SchemaV4 + def setUp(self): + super(TestValidatorV4, self).setUp() + self.metadata = { + 'name': 'plugin_name-12', + 'title': 'plugin_name-12', + 'version': '1.2.3', + 'package_version': '4.0.0', + 'description': 'Description', + 'fuel_version': ['8.0.0'], + 'licenses': ['Apache', 'BSD'], + 'authors': ['Author1', 'Author2'], + 'homepage': 'http://test.com', + 'releases': [ + { + "os": "ubuntu", + "version": "liberty-8.0", + "mode": ['ha'], + "deployment_scripts_path": "deployment_scripts/", + "repository_path": "repositories/ubuntu" + } + ], + 'groups': [], + 'is_hotpluggable': False + } + def test_check_schemas(self): mocked_methods = [ 'check_metadata_schema', @@ -243,6 +268,23 @@ class TestValidatorV4(TestValidatorV3): utils_mock.parse_yaml.return_value = [data] self.validator.check_components_schema() + @mock.patch('fuel_plugin_builder.validators.base.utils') + def test_groups(self, utils_mock): + groups_data = [ + ["network"], + ["storage"], + ["storage::cinder"], + ["storage::glance"], + ["hypervisor"], + ["equipment"], + ["storage::cinder", "equipment"], + [] + ] + for gd in groups_data: + self.metadata['groups'] = gd + utils_mock.parse_yaml.return_value = self.metadata + self.assertEqual(None, self.validator.check_metadata_schema()) + @mock.patch('fuel_plugin_builder.validators.base.utils') def test_check_deployment_task_reexecute_on(self, utils_mock): mock_data = [{ diff --git a/fuel_plugin_builder/validators/schemas/v4.py b/fuel_plugin_builder/validators/schemas/v4.py index b61ce87..6f206e2 100644 --- a/fuel_plugin_builder/validators/schemas/v4.py +++ b/fuel_plugin_builder/validators/schemas/v4.py @@ -307,6 +307,7 @@ class SchemaV4(SchemaV3): schema = super(SchemaV4, self).metadata_schema schema['required'].append('is_hotpluggable') schema['properties']['is_hotpluggable'] = {'type': 'boolean'} + schema['properties']['groups']['items']['enum'].append('equipment') return schema @property