From fc159bc8d98a06549b6b34928897a092a751928b Mon Sep 17 00:00:00 2001 From: marios Date: Tue, 5 Sep 2017 12:28:27 +0300 Subject: [PATCH] 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 --- tripleoclient/v1/overcloud_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tripleoclient/v1/overcloud_config.py b/tripleoclient/v1/overcloud_config.py index 1665ed694..0597d4400 100644 --- a/tripleoclient/v1/overcloud_config.py +++ b/tripleoclient/v1/overcloud_config.py @@ -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,