summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Gajsin <igajsin@mirantis.com>2017-03-17 19:23:27 +0300
committerIgor Gajsin <igajsin@mirantis.com>2017-03-20 16:51:39 +0300
commit8e12d76f86eccac41469f2f100b8fdab0bec0d6b (patch)
tree05dff17c24710097f67fd08bf57048d6c85db180
parentb232c9f9e79900ea5390a6cc4434a5c25ffbf781 (diff)
Reorder configs_query by time
There is the possibility to change OpenStack config after deployment. Changes could be applied per role. And in the case of multiple roles on a node, many changes could pretend to be applied. I.e. if we have a config for the role 'compute', a config for the role 'cinder' and a node with role 'cinder+compute' we have to choose one of them. Previous decision was 'sort it in the lexicographical order', so it applies 'cinder' then --- 'compute'. It is contra intuitive. The best option is applying to a node the last related config, to new config overlaps old ones. Change-Id: I7db388ca3baeb351adc9fdb70c55b0be50fafe48 Closes-bug: #1671521
Notes
Notes (review): Verified+1: Fuel CI <fuel-ci-bot@mirantis.com> Code-Review+1: Michael Polenchuk <mpolenchuk@mirantis.com> Code-Review+2: Alexander Kislitsky <akislitsky@mirantis.com> Code-Review+2: Aleksey Kasatkin <akasatkin@mirantis.com> Workflow+1: Aleksey Kasatkin <akasatkin@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 28 Mar 2017 13:29:33 +0000 Reviewed-on: https://review.openstack.org/447059 Project: openstack/fuel-web Branch: refs/heads/master
-rw-r--r--nailgun/nailgun/objects/openstack_config.py2
-rw-r--r--nailgun/nailgun/test/unit/test_stages_task_serialization.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/nailgun/nailgun/objects/openstack_config.py b/nailgun/nailgun/objects/openstack_config.py
index bf97622..f6e5ac0 100644
--- a/nailgun/nailgun/objects/openstack_config.py
+++ b/nailgun/nailgun/objects/openstack_config.py
@@ -104,7 +104,7 @@ class OpenstackConfigCollection(NailgunCollection):
104 """ 104 """
105 configs_query = cls.filter_by( 105 configs_query = cls.filter_by(
106 None, cluster_id=cluster.id, is_active=True) 106 None, cluster_id=cluster.id, is_active=True)
107 configs_query = configs_query.order_by(cls.single.model.node_role) 107 configs_query = configs_query.order_by(cls.single.model.created_at)
108 108
109 node_ids = set(n.id for n in nodes) 109 node_ids = set(n.id for n in nodes)
110 node_roles = set() 110 node_roles = set()
diff --git a/nailgun/nailgun/test/unit/test_stages_task_serialization.py b/nailgun/nailgun/test/unit/test_stages_task_serialization.py
index 0b0f0dd..11faa06 100644
--- a/nailgun/nailgun/test/unit/test_stages_task_serialization.py
+++ b/nailgun/nailgun/test/unit/test_stages_task_serialization.py
@@ -313,7 +313,7 @@ class TestHooksSerializers(BaseTaskSerializationTest):
313 'DEFAULT/param_b': {'value': 'value_cinder'} 313 'DEFAULT/param_b': {'value': 'value_cinder'}
314 }, 314 },
315 'keystone_config': { 315 'keystone_config': {
316 'DEFAULT/param_a': {'value': 'value_compute'}, 316 'DEFAULT/param_a': {'value': 'value_cinder'},
317 } 317 }
318 }}) 318 }})
319 319