1 Star 1 Fork 16

zhangxingrong/fence-agents

forked from src-openEuler/fence-agents 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-fencing-use-EC_OK.patch 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
From ec9d2d2b983d47a3c01be5fb3398b84ce09edfc9 Mon Sep 17 00:00:00 2001
From: razo7 <oraz@redhat.com>
Date: Mon, 24 Jul 2023 12:13:39 +0300
Subject: [PATCH 22/46] fencing: use EC_OK
EC_OK was not been used
---
lib/fencing.py.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/fencing.py.py b/lib/fencing.py.py
index 2c716b43..3a60f53e 100644
--- a/lib/fencing.py.py
+++ b/lib/fencing.py.py
@@ -938,7 +938,7 @@ def show_docs(options, docs=None):
sys.exit(0)
def fence_action(connection, options, set_power_fn, get_power_fn, get_outlet_list=None, reboot_cycle_fn=None, sync_set_power_fn=None):
- result = 0
+ result = EC_OK
try:
if "--plug" in options:
@@ -982,11 +982,11 @@ def fence_action(connection, options, set_power_fn, get_power_fn, get_outlet_lis
except UnicodeEncodeError as e:
print((outlet_id + options["--separator"] + alias).encode("utf-8") + options["--separator"] + status)
- return
+ return result
if options["--action"] == "monitor" and not "port" in options["device_opt"] and "no_status" in options["device_opt"]:
# Unable to do standard monitoring because 'status' action is not available
- return 0
+ return result
status = None
if not "no_status" in options["device_opt"]:
@@ -997,7 +997,7 @@ def fence_action(connection, options, set_power_fn, get_power_fn, get_outlet_lis
if options["--action"] == status:
if not (status == "on" and "force_on" in options["device_opt"]):
print("Success: Already %s" % (status.upper()))
- return 0
+ return result
if options["--action"] == "on":
if set_multi_power_fn(connection, options, set_power_fn, get_power_fn, sync_set_power_fn, 1 + int(options["--retry-on"])):
--
2.25.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangxingrong/fence-agents.git
git@gitee.com:zhangxingrong/fence-agents.git
zhangxingrong
fence-agents
fence-agents
master

搜索帮助