diff --git a/_lastrevision b/_lastrevision index 9bb178c..fc9f216 100644 --- a/_lastrevision +++ b/_lastrevision @@ -1 +1 @@ -100135e8eac75cc18e3e66fc99bbeed9f5592e88 \ No newline at end of file +02c119f814533eed60bd687a8d17286ef75dd94c \ No newline at end of file diff --git a/control-the-collection-of-lvm-grains-via-config.patch b/control-the-collection-of-lvm-grains-via-config.patch new file mode 100644 index 0000000..2926237 --- /dev/null +++ b/control-the-collection-of-lvm-grains-via-config.patch @@ -0,0 +1,37 @@ +From 0df204fb1ea7135ce0196f99a864d3f94bd6f92e Mon Sep 17 00:00:00 2001 +From: Alexander Graul +Date: Tue, 10 Jan 2023 15:04:01 +0100 +Subject: [PATCH] Control the collection of lvm grains via config + +lvm grain collection can take a long time on systems with a lot of +volumes and volume groups. On one server we measured ~3 minutes, which +is way too long for grains. + +This change is backwards-compatible, leaving the lvm grain collection +enabled by default. Users with a lot of lvm volumes/volume groups can +disable these grains in the minion config by setting + + enable_lvm_grains: False +--- + salt/grains/lvm.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/salt/grains/lvm.py b/salt/grains/lvm.py +index 586b187ddb..f5c406cb44 100644 +--- a/salt/grains/lvm.py ++++ b/salt/grains/lvm.py +@@ -17,6 +17,10 @@ __salt__ = { + log = logging.getLogger(__name__) + + ++def __virtual__(): ++ return __opts__.get("enable_lvm_grains", True) ++ ++ + def lvm(): + """ + Return list of LVM devices +-- +2.37.3 + + diff --git a/salt.changes b/salt.changes index 9116c49..066fd4f 100644 --- a/salt.changes +++ b/salt.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Jan 17 16:32:12 UTC 2023 - Pablo Suárez Hernández + +- Control the collection of lvm grains via config (bsc#1204939) + +- Added: + * control-the-collection-of-lvm-grains-via-config.patch + ------------------------------------------------------------------- Thu Jan 12 15:49:38 UTC 2023 - Pablo Suárez Hernández diff --git a/salt.spec b/salt.spec index 544d817..d67c2d1 100644 --- a/salt.spec +++ b/salt.spec @@ -301,6 +301,8 @@ Patch76: use-rlock-to-avoid-deadlocks-in-salt-ssh.patch Patch77: fixes-for-python-3.10-502.patch # PATCH-FIX_UPSTREAM: https://github.com/saltstack/salt/pull/62854 Patch78: allow-entrypoint-compatibility-for-importlib-metadat.patch +# PATCH-FIX-OPENSUSE: https://github.com/openSUSE/salt/pull/571 +Patch79: control-the-collection-of-lvm-grains-via-config.patch ### IMPORTANT: The line below is used as a snippet marker. Do not touch it. ### SALT PATCHES LIST END