diff --git a/tripleo_common/tests/utils/test_config.py b/tripleo_common/tests/utils/test_config.py index b0cb7bf1c..e805bdac6 100644 --- a/tripleo_common/tests/utils/test_config.py +++ b/tripleo_common/tests/utils/test_config.py @@ -130,16 +130,16 @@ class TestConfig(base.TestCase): 'service': 'name=fake state=stopped', 'tags': 'step1', - 'when': ['existingcondition', - 'step|int == 1']}, + 'when': ['step|int == 1', + 'existingcondition']}, {'name': 'Stop nova-' 'compute service', 'service': 'name=openstack-nova-' 'compute state=stopped', 'tags': 'step1', - 'when': ['existing', - 'list', 'step|int == 1']}]} + 'when': ['step|int == 1', + 'existing', 'list']}]} mock_get_role_data.return_value = fake_role for role in fake_role: diff --git a/tripleo_common/utils/config.py b/tripleo_common/utils/config.py index 81c5e8ca2..8ab0e4410 100644 --- a/tripleo_common/utils/config.py +++ b/tripleo_common/utils/config.py @@ -140,7 +140,7 @@ class Config(object): # Skip to the next task, # there is an existing 'step|int == N' continue - whenexpr.append("step|int == %s" % step) + whenexpr.insert(0, "step|int == %s" % step) task['when'] = whenexpr def _write_playbook_get_tasks(self, tasks, role, filepath):