Merge "Convert step to integer in when statement for upgrade tasks" into stable/pike
This commit is contained in:
commit
968a4da05e
|
@ -145,18 +145,18 @@ class TestOvercloudConfig(utils.TestCommand):
|
|||
'service': 'name=fake '
|
||||
'state=stopped',
|
||||
'tags': 'step1',
|
||||
'when': 'step == 1'}],
|
||||
'when': 'step|int == 1'}],
|
||||
'FakeCompute': [{'name': 'Stop fake service',
|
||||
'service': 'name=fake state=stopped',
|
||||
'tags': 'step1',
|
||||
'when': 'step == 1'},
|
||||
'when': 'step|int == 1'},
|
||||
{'name': 'Stop nova-'
|
||||
'compute service',
|
||||
'service':
|
||||
'name=openstack-nova-'
|
||||
'compute state=stopped',
|
||||
'tags': 'step1',
|
||||
'when': 'step == 1'}]
|
||||
'when': 'step|int == 1'}]
|
||||
}
|
||||
mock_get_role_data.return_value = fake_role
|
||||
|
||||
|
|
|
@ -71,9 +71,10 @@ class DownloadConfig(command.Command):
|
|||
when_exists = re.search('step.* == [0-9]', whenline)
|
||||
if when_exists: # skip if there is an existing 'step == N'
|
||||
continue
|
||||
task['when'] = "(%s) and (step == %s)" % (whenline, step)
|
||||
task['when'] = "(%s) and (step|int == %s)" % (whenline,
|
||||
step)
|
||||
else:
|
||||
task.update({"when": "step == %s" % step})
|
||||
task.update({"when": "step|int == %s" % step})
|
||||
|
||||
def _write_playbook_get_tasks(self, tasks, role, filepath):
|
||||
playbook = []
|
||||
|
|
Loading…
Reference in New Issue