Browse Source

Merge "Quote kolla limit when calling kolla-ansible"

changes/42/778442/1
Zuul 2 months ago
committed by Gerrit Code Review
parent
commit
a4919e1877
3 changed files with 8 additions and 3 deletions
  1. +1
    -1
      kayobe/kolla_ansible.py
  2. +2
    -2
      kayobe/tests/unit/test_kolla_ansible.py
  3. +5
    -0
      releasenotes/notes/quote-kolla-limit-042422e69c008109.yaml

+ 1
- 1
kayobe/kolla_ansible.py View File

@ -132,7 +132,7 @@ def build_args(parsed_args, command, inventory_filename, extra_vars=None,
cmd += ["-e", "%s=%s" % (extra_var_name, extra_var_value)]
if parsed_args.kolla_limit or limit:
limit_arg = utils.intersect_limits(parsed_args.kolla_limit, limit)
cmd += ["--limit", limit_arg]
cmd += ["--limit", utils.quote_and_escape(limit_arg)]
if parsed_args.kolla_skip_tags:
cmd += ["--skip-tags", parsed_args.kolla_skip_tags]
if parsed_args.kolla_tags or tags:


+ 2
- 2
kayobe/tests/unit/test_kolla_ansible.py View File

@ -69,7 +69,7 @@ class TestCase(unittest.TestCase):
"--configdir", "/path/to/config",
"--passwords", "/path/to/config/passwords.yml",
"-e", "ev_name1=ev_value1",
"--limit", "host1:host2",
"--limit", "'host1:host2'",
"--tags", "tag1,tag2",
]
expected_cmd = " ".join(expected_cmd)
@ -105,7 +105,7 @@ class TestCase(unittest.TestCase):
"--configdir", "/path/to/config",
"--passwords", "/path/to/config/passwords.yml",
"-e", "ev_name1=ev_value1",
"--limit", "host1:host2",
"--limit", "'host1:host2'",
"--skip-tags", "tag3,tag4",
"--tags", "tag1,tag2",
]


+ 5
- 0
releasenotes/notes/quote-kolla-limit-042422e69c008109.yaml View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixes calls to ``kolla-ansible`` when arguments to ``--kolla-limit``
contain special characters such as ``~`` or ``&``.

Loading…
Cancel
Save