代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/fence-agents 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 9ebd2e2e36ae0de5c9164f4ac3fd29bdac0cab61 Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <[email protected]>
Date: Thu, 14 Feb 2019 10:03:33 +0100
Subject: [PATCH] fence_redfish: use "ipport" parameter and improve logging
---
agents/redfish/fence_redfish.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/agents/redfish/fence_redfish.py b/agents/redfish/fence_redfish.py
index 5b719d4b..28840058 100644
--- a/agents/redfish/fence_redfish.py
+++ b/agents/redfish/fence_redfish.py
@@ -22,7 +22,10 @@ def get_power_status(conn, options):
fail_usage("Couldn't get power information")
data = response['data']
- logging.debug("PowerState is: " + data[u'PowerState'])
+ try:
+ logging.debug("PowerState is: " + data[u'PowerState'])
+ except Exception:
+ fail_usage("Unable to get PowerState: " + "https://" + options["--ip"] + ":" + str(options["--ipport"]) + options["--systems-uri"])
if data[u'PowerState'].strip() == "Off":
return "off"
@@ -52,7 +55,7 @@ def set_power_status(conn, options):
return
def send_get_request(options, uri):
- full_uri = "https://" + options["--ip"] + uri
+ full_uri = "https://" + options["--ip"] + ":" + str(options["--ipport"]) + uri
try:
resp = requests.get(full_uri, verify=not "--ssl-insecure" in options,
auth=(options["--username"], options["--password"]))
@@ -62,7 +65,7 @@ def send_get_request(options, uri):
return {'ret': True, 'data': data}
def send_post_request(options, uri, payload, headers):
- full_uri = "https://" + options["--ip"] + uri
+ full_uri = "https://" + options["--ip"] + ":" + str(options["--ipport"]) + uri
try:
requests.post(full_uri, data=json.dumps(payload),
headers=headers, verify=not "--ssl-insecure" in options,
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。