mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Regularize yumpkg option separators
Add logging and convert to formatted string literal. Other Yum options uses equal sign as separator but setopt separator is irregular using space as separator. Fix: https://github.com/saltstack/salt/issues/66970
This commit is contained in:
parent
28662c490b
commit
e3f25965af
2 changed files with 12 additions and 21 deletions
|
@ -315,7 +315,8 @@ def _get_options(**kwargs):
|
|||
ret.append(f"--branch={branch}")
|
||||
|
||||
for item in setopt:
|
||||
ret.extend(["--setopt", str(item)])
|
||||
log.info("Adding configuration option '%s'", item)
|
||||
ret.extend([f"--setopt={item}"])
|
||||
|
||||
if get_extra_options:
|
||||
# sorting here to make order uniform, makes unit testing more reliable
|
||||
|
|
|
@ -1423,10 +1423,8 @@ def test_install_with_options():
|
|||
"--disablerepo=*",
|
||||
"--enablerepo=good",
|
||||
"--branch=foo",
|
||||
"--setopt",
|
||||
"obsoletes=0",
|
||||
"--setopt",
|
||||
"plugins=0",
|
||||
"--setopt=obsoletes=0",
|
||||
"--setopt=plugins=0",
|
||||
"install",
|
||||
"foo",
|
||||
],
|
||||
|
@ -1454,10 +1452,8 @@ def test_install_with_options():
|
|||
"--disablerepo=bad",
|
||||
"--enablerepo=good",
|
||||
"--branch=foo",
|
||||
"--setopt",
|
||||
"obsoletes=0",
|
||||
"--setopt",
|
||||
"plugins=0",
|
||||
"--setopt=obsoletes=0",
|
||||
"--setopt=plugins=0",
|
||||
"install",
|
||||
"foo",
|
||||
],
|
||||
|
@ -1852,10 +1848,8 @@ def test_upgrade_with_options():
|
|||
"--disablerepo=*",
|
||||
"--enablerepo=good",
|
||||
"--branch=foo",
|
||||
"--setopt",
|
||||
"obsoletes=0",
|
||||
"--setopt",
|
||||
"plugins=0",
|
||||
"--setopt=obsoletes=0",
|
||||
"--setopt=plugins=0",
|
||||
"--exclude=kernel*",
|
||||
"--nogpgcheck",
|
||||
"upgrade",
|
||||
|
@ -1897,10 +1891,8 @@ def test_upgrade_with_options():
|
|||
"--disablerepo=bad",
|
||||
"--enablerepo=good",
|
||||
"--branch=foo",
|
||||
"--setopt",
|
||||
"obsoletes=0",
|
||||
"--setopt",
|
||||
"plugins=0",
|
||||
"--setopt=obsoletes=0",
|
||||
"--setopt=plugins=0",
|
||||
"--exclude=kernel*",
|
||||
"upgrade",
|
||||
],
|
||||
|
@ -3046,10 +3038,8 @@ def test_pkg_update_dnf():
|
|||
"dnf",
|
||||
"--quiet",
|
||||
"-y",
|
||||
"--setopt",
|
||||
"plugins=0",
|
||||
"--setopt",
|
||||
"obsoletes=False",
|
||||
"--setopt=plugins=0",
|
||||
"--setopt=obsoletes=False",
|
||||
"upgrade",
|
||||
"foo",
|
||||
],
|
||||
|
|
Loading…
Add table
Reference in a new issue