-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add setting for forcing refresh in zypper #56419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add setting for forcing refresh in zypper #56419
Conversation
9be7bf7 to
7bd6e14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Sorry, had to revert my initial review.
salt/modules/zypperpkg.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, wait a sec. I think the root kwarg is not yet introducted here. Could you check that please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, that will be introduced with #54954
7bd6e14 to
27c6bfe
Compare
brejoc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
The default will still be forcing refresh to keep existing setups working. 1. Pillar option to turn off force refresh ``` zypper: refreshdb_force: false ``` 2. Cmdline option to force refresh. ``` salt '*' pkg.refresh_db [force=true|false] ``` The cmdline option will override the pillar as well. Co-authored-by: Alexander Graul <agraul@suse.com>
27c6bfe to
ea81719
Compare
By default, all zypper calls are run with --force. This is not necessary and wastes time. Reference: saltstack/salt#56419 Signed-off-by: Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>
What does this PR do?
Currently
salt '*' pkg.refresh_dbwill always callzypper refreshwith--forcewhenzypperis used as the backend. With this PR, this behavior can be controlled. It leaves the default as it is, but allows a CLI flag and/or a pillar entry to control if a repository is refreshed with--force.What issues does this PR fix or reference?
Previous Behavior
salt '*' pkg.refresh_db->zypper refresh --forceNew Behavior
salt '*' pkg.refresh_db->zypper refresh --forcesalt '*' pkg.refresh_db force=true->zypper refresh --forcesalt '*' pkg.refresh_db force=false->zypper refreshAlternatively, a pillar setting can be used (which is overridden by the CLI option):
Tests written?
Yes
Commits signed with GPG?
Yes