Open ben-grande opened 3 weeks ago
I know it wouldn't be very consistent, but maybe a better approach is to adjust qubes-dom0-update
to understand that --setopt
has an argument? I hope it applies to only very few options used by salt (for example --enablerepo=
works just fine), maybe just --setopt
.
I know it wouldn't be very consistent, but maybe a better approach is to adjust
qubes-dom0-update
to understand that--setopt
has an argument?
I can check if setopt item does not contain =
and them replace the space between it and the next item with =
, which I guess is less prone to mistakes as maintainer might forget to patch the setopt line when upgrading yumpkg from upstream.
I hope it applies to only very few options used by salt (for example
--enablerepo=
works just fine), maybe just--setopt
.
I don't have the percentage of how many Yum options Salt covers, but not all for sure, which can cause inconsistencies. In this case, as it covers --enablerepo= with the correct separator, it doesn't cause problems.
It is actually an inconsistency on the salt code to not have the =
separator, see how setopt differs:
if fromrepo:
...
ret.extend(["--disablerepo=*", f"--enablerepo={fromrepo}"])
else:
...
ret.extend([f"--disablerepo={x}" for x in targets])
if enablerepo:
...
ret.extend([f"--enablerepo={x}" for x in targets])
if disableexcludes:
...
ret.append(f"--disableexcludes={disableexcludes}")
if branch:
...
ret.append(f"--branch={branch}")
for item in setopt:
ret.extend(["--setopt", str(item)])
if get_extra_options:
...
ret.append(f"--{key}={value}")
Well, as setopt was irregular compared to the other options, I believe that give us some leverage to fix it upstream as it would benefit them also to have a standard format:
But in case it is not accepted or delayed to be in a release packaged in Qubes:
PR was merged to upstream's 3006.x
branch. Next release 3006.10
might take some time as there are 38 open issues to complete that milestone. Now it is your choice to wait for the 3006.10
release or merging one of these PRs:
This issue can be closed if just waiting for upstream.
How to file a helpful issue
Qubes OS release
R4.2
Brief summary
On qubes-dom0-update, can't pass value of an option separated by space as it is treated differently.
This is especially problematic when the format of the command can't be controlled, such as when using Salt.
Setopt value separated by space fails:
Setopt separated by
=
works:Steps to reproduce
With the salt state:
Targetting dom0:
Targetting a fedora-40 qube:
Expected behavior
Qubes Salt module builds command line to qubes-dom0-update that doesn't fail when it is a valid dnf syntax.
Actual behavior
Same state that works on Fedora qubes fails on Dom0 due to how qubes-dom0-update interpret arguments.