Fix py27 tests - expand the regex when adding 'when' to playbook
In I4ee1a2729d74442570f1b1f38b0d03a95ea7793f the 'when' condition written to the upgrade_tasks playbook got an |int but we didn't expand the search for an existing 'when' to take this into account Change-Id: I69f28a0fabd75eb19c0eedfcbdc037094a9ddb50 Related-Bug: 1708115
This commit is contained in:
parent
4e366ec76c
commit
fc159bc8d9
|
@ -62,7 +62,7 @@ class DownloadConfig(command.Command):
|
|||
step = match.group(1)
|
||||
whenline = task.get('when', None)
|
||||
if whenline: # how about list of when conditionals
|
||||
when_exists = re.search('step == [0-9]', whenline)
|
||||
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|int == %s)" % (whenline,
|
||||
|
|
Loading…
Reference in New Issue