config: Always add step conditional first for upgrade_tasks
This is required to ensure conditionals using variables set by prior steps are not evaluated prior to these steps running. Closes-bug: #1732888 Change-Id: I9f6d60f22ef4c057a0d5f47ac2bd4f08520faeec
This commit is contained in:
parent
2a9012a3f0
commit
78a5bc0554
|
@ -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:
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue