Nailgun Fixes for smart configuration changes support

Simply unhardcode the handler for $.configuration namespace
to allow a user to modify anything he wants in this namespace.
The list of modifyable sections on '$.configuration' namespace of astute.yaml
should not be hardcoded - this makes no sense as support of these pieces
is implemented on fuel library and plugins side. Hardcoding the list
will make it impossible for a plugin developer to reuse configuration
changes feature to support configuration options for plugin.

DocImpact

Partial-bug: #1580522

Change-Id: I4eb18461c0a4f337b649abfcd099259965290ff5
This commit is contained in:
Vladimir Kuklin 2016-04-12 16:05:26 +03:00
parent 2b82c053cc
commit 5b2607ab8f
2 changed files with 0 additions and 38 deletions

View File

@ -27,12 +27,6 @@ class OpenstackConfigValidator(BasicValidator):
exclusive_fields = frozenset(['node_id', 'node_ids', 'node_role'])
supported_configs = frozenset([
'nova_config', 'nova_paste_api_ini', 'neutron_config',
'neutron_api_config', 'neutron_plugin_ml2', 'neutron_agent_ovs',
'neutron_l3_agent_config', 'neutron_dhcp_agent_config',
'neutron_metadata_agent_config', 'keystone_config'])
@staticmethod
def _check_no_running_deploy_tasks(cluster):
"""Check that no deploy tasks are running at the moment
@ -128,7 +122,6 @@ class OpenstackConfigValidator(BasicValidator):
Validation fails if there are running deployment tasks in cluster.
"""
data = cls._validate_data(data, schema.OPENSTACK_CONFIG)
cls._check_supported_configs(data)
return data
@classmethod
@ -207,14 +200,3 @@ class OpenstackConfigValidator(BasicValidator):
raise errors.InvalidData(
"Parameter '{0}' conflicts with '{1}' ".format(
keys[0], ', '.join(keys[1:])))
@classmethod
def _check_supported_configs(cls, data):
"""Check that all provided configurations can be updated"""
unsupported_configs = set(
data['configuration']) - cls.supported_configs
if unsupported_configs:
raise errors.InvalidData(
"Configurations '{0}' can not be updated".format(
', '.join(unsupported_configs)))

View File

@ -190,26 +190,6 @@ class TestOpenstackConfigHandlers(BaseIntegrationTest):
"Nodes '{0}' are not assigned to cluster '{1}'".format(
self.nodes[1].id, self.clusters[1].id))
def test_openstack_config_upload_fail_not_supported_config(self):
"""Test for uploading an update for not supported OpenStack config"""
data = {
'cluster_id': self.clusters[0].id,
'node_id': self.nodes[0].id,
'configuration': {
'not_supported_config': {}
}
}
resp = self.app.post(
reverse('OpenstackConfigCollectionHandler'),
jsonutils.dumps(data),
headers=self.default_headers,
expect_errors=True)
self.assertEqual(resp.status_code, 400)
self.assertRegexpMatches(
resp.json_body['message'],
r"Configurations '\w+' can not be updated")
def test_openstack_config_upload_fail_deploy_running(self):
deploy_task_id = self.create_running_deployment_task()
data = {