1 Star 0 Fork 16

bixiaoyan/fence-agents

forked from src-openEuler/fence-agents 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bz1732773-fence_vmware_rest-fix-keyerror-suspended-vms.patch 1018 Bytes
一键复制 编辑 原始数据 按行查看 历史
liqiuyu 提交于 2020-11-20 11:45 . Resolve agent redfish compilation fail
From 33a638ff624839d7fa2d409479c348abee57763e Mon Sep 17 00:00:00 2001
From: dwannamaker-onr <[email protected]>
Date: Tue, 25 Jun 2019 15:28:00 -0400
Subject: [PATCH] Fixed issue with SUSPENDED VMs
If any VMs in the vCenter are suspended, you get a KeyError because that state is not expected. This breaks list and monitor actions.
---
agents/vmware_rest/fence_vmware_rest.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/agents/vmware_rest/fence_vmware_rest.py b/agents/vmware_rest/fence_vmware_rest.py
index b544d385..53b4066d 100644
--- a/agents/vmware_rest/fence_vmware_rest.py
+++ b/agents/vmware_rest/fence_vmware_rest.py
@@ -8,7 +8,7 @@
from fencing import *
from fencing import fail, run_delay, EC_LOGIN_DENIED, EC_STATUS
-state = {"POWERED_ON": "on", 'POWERED_OFF': "off"}
+state = {"POWERED_ON": "on", 'POWERED_OFF': "off", 'SUSPENDED': "off"}
def get_power_status(conn, options):
res = send_command(conn, "vcenter/vm?filter.names={}".format(options["--plug"]))["value"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bixiaoyan1/fence-agents.git
[email protected]:bixiaoyan1/fence-agents.git
bixiaoyan1
fence-agents
fence-agents
master

搜索帮助