Use shlex_quote for complete --foo=bar argument.

Without that, the resulting string is `--foo="'bar'"`
which results in `'bar'` being passed to Koji task.

With this commit, the resulting string is `"'--foo=bar'"`
which results in `bar` being passed to Koji which is expected.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
This commit is contained in:
Jan Kaluza 2020-10-29 16:17:18 +01:00
parent 4c297beb65
commit d1eac95cda
1 changed files with 2 additions and 2 deletions

View File

@ -197,7 +197,7 @@ class KojiWrapper(object):
cmd.append(k)
else:
for arg in force_list(v):
cmd.append("%s=%s" % (k, shlex_quote(arg)))
cmd.append(shlex_quote("%s=%s" % (k, arg)))
return cmd
@ -235,7 +235,7 @@ class KojiWrapper(object):
cmd.append(k)
else:
for arg in force_list(v):
cmd.append("%s=%s" % (k, shlex_quote(arg)))
cmd.append(shlex_quote("%s=%s" % (k, arg)))
return cmd