Blame SOURCES/bz1886074-4-fencing-source_env-dont-process-empty-lines.patch
|
|
df7736 |
From fbca33a536413565108374dd4ed3237b6f7896bd Mon Sep 17 00:00:00 2001
|
|
|
df7736 |
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
|
|
|
df7736 |
Date: Mon, 15 Aug 2022 10:40:19 +0200
|
|
|
df7736 |
Subject: [PATCH] fencing: source_env(): dont process empty lines
|
|
|
df7736 |
|
|
|
df7736 |
---
|
|
|
df7736 |
lib/fencing.py.py | 2 +-
|
|
|
df7736 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
df7736 |
|
|
|
df7736 |
diff --git a/lib/fencing.py.py b/lib/fencing.py.py
|
|
|
df7736 |
index fc3679e33..940bd01d1 100644
|
|
|
df7736 |
--- a/lib/fencing.py.py
|
|
|
df7736 |
+++ b/lib/fencing.py.py
|
|
|
df7736 |
@@ -1264,7 +1264,7 @@ def source_env(env_file):
|
|
|
df7736 |
executable="/bin/sh")
|
|
|
df7736 |
# replace env
|
|
|
df7736 |
os.environ.clear()
|
|
|
df7736 |
- os.environ.update(line.partition('=')[::2] for line in output.decode("utf-8").split('\0'))
|
|
|
df7736 |
+ os.environ.update(line.partition('=')[::2] for line in output.decode("utf-8").split('\0') if not re.match("^\s*$", line))
|
|
|
df7736 |
|
|
|
df7736 |
# Convert array of format [[key1, value1], [key2, value2], ... [keyN, valueN]] to dict, where key is
|
|
|
df7736 |
# in format a.b.c.d...z and returned dict has key only z
|