Skip to content

Conversation

@agraul
Copy link
Collaborator

@agraul agraul commented Mar 20, 2020

What does this PR do?

Currently salt '*' pkg.refresh_db will always call zypper refresh with --force when zypper is 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 --force

New Behavior

salt '*' pkg.refresh_db -> zypper refresh --force
salt '*' pkg.refresh_db force=true -> zypper refresh --force
salt '*' pkg.refresh_db force=false -> zypper refresh

Alternatively, a pillar setting can be used (which is overridden by the CLI option):

zypper:
  refreshdb_force: false

Tests written?

Yes

Commits signed with GPG?

Yes

@agraul agraul requested a review from a team as a code owner March 20, 2020 11:08
@ghost ghost requested a review from Ch3LL March 20, 2020 11:08
@agraul agraul force-pushed the add-option-disable-zypper-force-refresh branch from 9be7bf7 to 7bd6e14 Compare March 20, 2020 11:38
Copy link
Contributor

@brejoc brejoc left a 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.

Copy link
Contributor

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?

Copy link
Collaborator Author

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

@agraul agraul force-pushed the add-option-disable-zypper-force-refresh branch from 7bd6e14 to 27c6bfe Compare March 20, 2020 14:28
@agraul agraul requested a review from brejoc March 20, 2020 14:42
brejoc
brejoc previously approved these changes Mar 23, 2020
Copy link
Contributor

@brejoc brejoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

darix and others added 2 commits April 7, 2020 11:41
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>
@agraul agraul force-pushed the add-option-disable-zypper-force-refresh branch from 27c6bfe to ea81719 Compare April 7, 2020 09:43
@Ch3LL Ch3LL removed the request for review from a team April 15, 2020 14:17
@Ch3LL Ch3LL self-assigned this Apr 15, 2020
@dwoz dwoz merged commit b4d5ba2 into saltstack:master Apr 23, 2020
@sagetherage sagetherage added the ZRelease-Sodium retired label label May 18, 2020
tacerus added a commit to openSUSE/heroes-salt that referenced this pull request Oct 30, 2023
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ZRelease-Sodium retired label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants