Blame SOURCES/bz1886074-1-fencing-source_env.patch

35697a
--- a/lib/fencing.py.py	2022-04-22 10:25:59.347139685 +0200
35697a
+++ b/lib/fencing.py.py	2022-04-22 10:26:05.127169492 +0200
35697a
@@ -1115,6 +1115,14 @@
35697a
 	except pexpect.ExceptionPexpect:
35697a
 		pass
35697a
 
35697a
+def source_env(env_file):
35697a
+    # POSIX: name shall not contain '=', value doesn't contain '\0'
35697a
+    output = subprocess.check_output("source {} && env -0".format(env_file), shell=True,
35697a
+                          executable="/bin/sh")
35697a
+    # replace env
35697a
+    os.environ.clear()
35697a
+    os.environ.update(line.partition('=')[::2] for line in output.decode("utf-8").split('\0'))
35697a
+
35697a
 # Convert array of format [[key1, value1], [key2, value2], ... [keyN, valueN]] to dict, where key is
35697a
 # in format a.b.c.d...z and returned dict has key only z
35697a
 def array_to_dict(array):