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:
marios 2017-09-05 12:28:27 +03:00
parent 4e366ec76c
commit fc159bc8d9
1 changed files with 1 additions and 1 deletions

View File

@ -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,