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
(cherry picked from commit 78a5bc0554
)
This commit is contained in:
parent
a95aa5ad8f
commit
1b8af1e043
|
@ -120,16 +120,16 @@ class TestConfig(base.TestCase):
|
||||||
'service':
|
'service':
|
||||||
'name=fake state=stopped',
|
'name=fake state=stopped',
|
||||||
'tags': 'step1',
|
'tags': 'step1',
|
||||||
'when': ['existingcondition',
|
'when': ['step|int == 1',
|
||||||
'step|int == 1']},
|
'existingcondition']},
|
||||||
{'name': 'Stop nova-'
|
{'name': 'Stop nova-'
|
||||||
'compute service',
|
'compute service',
|
||||||
'service':
|
'service':
|
||||||
'name=openstack-nova-'
|
'name=openstack-nova-'
|
||||||
'compute state=stopped',
|
'compute state=stopped',
|
||||||
'tags': 'step1',
|
'tags': 'step1',
|
||||||
'when': ['existing',
|
'when': ['step|int == 1',
|
||||||
'list', 'step|int == 1']}]}
|
'existing', 'list']}]}
|
||||||
mock_get_role_data.return_value = fake_role
|
mock_get_role_data.return_value = fake_role
|
||||||
|
|
||||||
for role in fake_role:
|
for role in fake_role:
|
||||||
|
|
|
@ -67,7 +67,7 @@ class Config(object):
|
||||||
# Skip to the next task,
|
# Skip to the next task,
|
||||||
# there is an existing 'step|int == N'
|
# there is an existing 'step|int == N'
|
||||||
continue
|
continue
|
||||||
whenexpr.append("step|int == %s" % step)
|
whenexpr.insert(0, "step|int == %s" % step)
|
||||||
task['when'] = whenexpr
|
task['when'] = whenexpr
|
||||||
else:
|
else:
|
||||||
task.update({"when": "step|int == %s" % step})
|
task.update({"when": "step|int == %s" % step})
|
||||||
|
|
Loading…
Reference in New Issue