SHA256
1
0
forked from pool/salt

Accepting request 1059578 from systemsmanagement:saltstack

- Control the collection of lvm grains via config (bsc#1204939)
- Added:
  * control-the-collection-of-lvm-grains-via-config.patch

OBS-URL: https://build.opensuse.org/request/show/1059578
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/salt?expand=0&rev=135
This commit is contained in:
Dominique Leuenberger 2023-01-20 16:38:09 +00:00 committed by Git OBS Bridge
commit 308f5b2edf
4 changed files with 48 additions and 1 deletions

View File

@ -1 +1 @@
100135e8eac75cc18e3e66fc99bbeed9f5592e88
02c119f814533eed60bd687a8d17286ef75dd94c

View File

@ -0,0 +1,37 @@
From 0df204fb1ea7135ce0196f99a864d3f94bd6f92e Mon Sep 17 00:00:00 2001
From: Alexander Graul <agraul@suse.com>
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

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Jan 17 16:32:12 UTC 2023 - Pablo Suárez Hernández <pablo.suarezhernandez@suse.com>
- 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 <pablo.suarezhernandez@suse.com>

View File

@ -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