8 Star 0 Fork 8

src-anolis-os / fence-agents

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bz2041933-bz2041935-3-fencing-source_env-dont-process-empty-lines.patch 957 Bytes
一键复制 编辑 原始数据 按行查看 历史
Zhao Hang 提交于 2023-06-20 15:19 . update to fence-agents-4.10.0-43.el9
From fbca33a536413565108374dd4ed3237b6f7896bd Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Mon, 15 Aug 2022 10:40:19 +0200
Subject: [PATCH] fencing: source_env(): dont process empty lines
---
lib/fencing.py.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/fencing.py.py b/lib/fencing.py.py
index fc3679e33..940bd01d1 100644
--- a/lib/fencing.py.py
+++ b/lib/fencing.py.py
@@ -1264,7 +1264,7 @@ def source_env(env_file):
executable="/bin/sh")
# replace env
os.environ.clear()
- os.environ.update(line.partition('=')[::2] for line in output.decode("utf-8").split('\0'))
+ os.environ.update(line.partition('=')[::2] for line in output.decode("utf-8").split('\0') if not re.match("^\s*$", line))
# Convert array of format [[key1, value1], [key2, value2], ... [keyN, valueN]] to dict, where key is
# in format a.b.c.d...z and returned dict has key only z
1
https://gitee.com/src-anolis-os/fence-agents.git
git@gitee.com:src-anolis-os/fence-agents.git
src-anolis-os
fence-agents
fence-agents
a8

搜索帮助

53164aa7 5694891 3bd8fe86 5694891