Fix container image build with multiple regexes

We don't need to provide additional quotes for passing these arguments
to playbooks, since this is now done automatically via
kayobe.utils.quote_and_escape.

Change-Id: I9588b58449e8c8f8eab85ce01b4e130adc150ac6
Story: 2006475
Task: 36416
This commit is contained in:
Mark Goddard 2019-09-11 15:30:33 +01:00
parent 1f83d69aca
commit 1e5fb00754
3 changed files with 11 additions and 4 deletions

View File

@ -740,7 +740,7 @@ class SeedContainerImageBuild(KayobeAnsibleMixin, VaultMixin, Command):
"container-image-build") "container-image-build")
extra_vars = {"push_images": parsed_args.push} extra_vars = {"push_images": parsed_args.push}
if parsed_args.regex: if parsed_args.regex:
regexes = "'%s'" % " ".join(parsed_args.regex) regexes = " ".join(parsed_args.regex)
extra_vars["container_image_regexes"] = regexes extra_vars["container_image_regexes"] = regexes
else: else:
extra_vars["container_image_sets"] = ( extra_vars["container_image_sets"] = (
@ -1422,7 +1422,7 @@ class OvercloudContainerImageBuild(KayobeAnsibleMixin, VaultMixin, Command):
"container-image-build") "container-image-build")
extra_vars = {"push_images": parsed_args.push} extra_vars = {"push_images": parsed_args.push}
if parsed_args.regex: if parsed_args.regex:
regexes = "'%s'" % " ".join(parsed_args.regex) regexes = " ".join(parsed_args.regex)
extra_vars["container_image_regexes"] = regexes extra_vars["container_image_regexes"] = regexes
else: else:
extra_vars["container_image_sets"] = ( extra_vars["container_image_sets"] = (

View File

@ -829,7 +829,7 @@ class TestCase(unittest.TestCase):
"ansible", "container-image-build.yml") "ansible", "container-image-build.yml")
], ],
extra_vars={ extra_vars={
"container_image_regexes": "'^regex1$ ^regex2$'", "container_image_regexes": "^regex1$ ^regex2$",
"push_images": True, "push_images": True,
} }
), ),
@ -1781,7 +1781,7 @@ class TestCase(unittest.TestCase):
"ansible", "container-image-build.yml") "ansible", "container-image-build.yml")
], ],
extra_vars={ extra_vars={
"container_image_regexes": "'^regex1$ ^regex2$'", "container_image_regexes": "^regex1$ ^regex2$",
"push_images": True, "push_images": True,
} }
), ),

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Fixes an issue when specifying multiple regular expressions to the ``kayobe
seed container image build`` and ``kayobe overcloud container image build``
commands. See `story 2006475
<https://storyboard.openstack.org/#!/story/2006475>`__ for details.