2021-01-08 13:41:50 +01:00
|
|
|
From c8c567a1540ae45012831718e945a1d54b328219 Mon Sep 17 00:00:00 2001
|
2020-05-26 10:05:14 +02:00
|
|
|
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>
|
|
|
|
---
|
2021-01-08 13:41:50 +01:00
|
|
|
salt/modules/zypperpkg.py | 5 +----
|
|
|
|
1 file changed, 1 insertion(+), 4 deletions(-)
|
2020-05-26 10:05:14 +02:00
|
|
|
|
|
|
|
diff --git a/salt/modules/zypperpkg.py b/salt/modules/zypperpkg.py
|
2021-01-08 13:41:50 +01:00
|
|
|
index c3342ab6d1..b75572f4ff 100644
|
2020-05-26 10:05:14 +02:00
|
|
|
--- a/salt/modules/zypperpkg.py
|
|
|
|
+++ b/salt/modules/zypperpkg.py
|
2021-01-08 13:41:50 +01:00
|
|
|
@@ -1348,7 +1348,7 @@ def mod_repo(repo, **kwargs):
|
2020-05-26 10:05:14 +02:00
|
|
|
return repo
|
|
|
|
|
|
|
|
|
2021-01-08 13:41:50 +01:00
|
|
|
-def refresh_db(force=None, root=None):
|
2020-05-26 10:05:14 +02:00
|
|
|
+def refresh_db(root=None, force=None):
|
2021-01-08 13:41:50 +01:00
|
|
|
"""
|
|
|
|
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):
|
2020-05-26 10:05:14 +02:00
|
|
|
|
2021-01-08 13:41:50 +01:00
|
|
|
{'<database name>': Bool}
|
2020-05-26 10:05:14 +02:00
|
|
|
|
|
|
|
- root
|
|
|
|
- operate on a different root directory.
|
2021-01-08 13:41:50 +01:00
|
|
|
-
|
2020-05-26 10:05:14 +02:00
|
|
|
CLI Example:
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
--
|
2021-01-08 13:41:50 +01:00
|
|
|
2.29.2
|
2020-05-26 10:05:14 +02:00
|
|
|
|
|
|
|
|