Merge "config: Always add step conditional first for upgrade_tasks" into stable/pike

This commit is contained in:
Zuul 2017-11-28 16:50:58 +00:00 committed by Gerrit Code Review
commit c9b8029339
2 changed files with 5 additions and 5 deletions

View File

@ -120,16 +120,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:

View File

@ -69,7 +69,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):