SHA256
1
0
forked from pool/salt
salt/option-to-en-disable-force-refresh-in-zypper-215.patch

55 lines
1.3 KiB
Diff

From c8c567a1540ae45012831718e945a1d54b328219 Mon Sep 17 00:00:00 2001
From: darix <darix@users.noreply.github.com>
Date: Tue, 12 May 2020 13:58:15 +0200
Subject: [PATCH] Option to en-/disable force refresh in zypper (#215)
The default will still be force 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>
---
salt/modules/zypperpkg.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/salt/modules/zypperpkg.py b/salt/modules/zypperpkg.py
index c3342ab6d1..b75572f4ff 100644
--- a/salt/modules/zypperpkg.py
+++ b/salt/modules/zypperpkg.py
@@ -1348,7 +1348,7 @@ def mod_repo(repo, **kwargs):
return repo
-def refresh_db(force=None, root=None):
+def refresh_db(root=None, force=None):
"""
Trigger a repository refresh by calling ``zypper refresh``. Refresh will run
with ``--force`` if the "force=True" flag is passed on the CLI or
@@ -1359,9 +1359,6 @@ def refresh_db(force=None, root=None):
{'<database name>': Bool}
- root
- operate on a different root directory.
-
CLI Example:
.. code-block:: bash
--
2.29.2