代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/fence-agents 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 3ea95247a182598f8b0d4aa24f417569f3efaa82 Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Mon, 24 Jul 2023 12:13:16 +0200
Subject: [PATCH 24/46] fa-dev-guide: add reboot_cycle() section
---
doc/fa-dev-guide.md | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/doc/fa-dev-guide.md b/doc/fa-dev-guide.md
index 8c349274..0ab8f770 100644
--- a/doc/fa-dev-guide.md
+++ b/doc/fa-dev-guide.md
@@ -127,6 +127,31 @@ def get_list(conn, options):
return outlets
```
+### reboot_cycle()
+***The reboot cycle method is not recommended as it might report success before the node is powered off.***
+- fence_ipmilan contains a minimal reboot_cycle() approach.
+- Add "method" to the device_opt list.
+- Update all_opt["method"]["help"] with a warning that it might report success before the node is powered off.
+- Add reboot_cycle function to fence_action() call in main().
+
+Example:
+```
+def reboot_cycle(_, options):
+ output = _run_command(options, "cycle")
+ return bool(re.search('chassis power control: cycle', str(output).lower()))
+...
+
+def main():
+...
+ device_opt = [ ..., "method" ]
+...
+ all_opt["method"]["help"] = "-m, --method=[method] Method to fence (onoff|cycle) (Default: onoff)\n" \
+ "WARNING! This fence agent might report success before the node is powered off. " \
+ "You should use -m/method onoff if your fence device works correctly with that option."
+...
+ result = fence_action(None, options, set_power_status, get_power_status, None, reboot_cycle)
+```
+
### define_new_opts()
Specifies device specific parameters with defaults.
- getopt is ":" for parameters that require a value and "" for parameters that get set without a value (e.g. -v)
--
2.25.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。