[Debian-ha-commits] [fence-agents] 02/04: New upstream version 4.1.1
Valentin Vidic
vvidic-guest at moszumanska.debian.org
Fri Feb 16 10:22:33 UTC 2018
This is an automated email from the git hooks/post-receive script.
vvidic-guest pushed a commit to branch master
in repository fence-agents.
commit 51d821feea0c6a18e8d48ce8ef4055cfbab43a2d
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date: Fri Feb 16 10:58:52 2018 +0100
New upstream version 4.1.1
---
fence/agents/heuristics_ping/fence_heuristics_ping.py | 2 +-
fence/agents/powerman/fence_powerman.py | 2 +-
fence/agents/pve/fence_pve.py | 19 +++++++++++++++----
tests/data/metadata/fence_pve.xml | 5 +++++
4 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/fence/agents/heuristics_ping/fence_heuristics_ping.py b/fence/agents/heuristics_ping/fence_heuristics_ping.py
index e5acc96..619d39b 100644
--- a/fence/agents/heuristics_ping/fence_heuristics_ping.py
+++ b/fence/agents/heuristics_ping/fence_heuristics_ping.py
@@ -72,7 +72,7 @@ def ping_test(con, options):
p[target].wait()
if p[target].returncode == 0:
for line in p[target].stdout:
- searchres = packet_count.search(line)
+ searchres = packet_count.search(line.decode())
if searchres:
good = int(searchres.group(1))
break
diff --git a/fence/agents/powerman/fence_powerman.py b/fence/agents/powerman/fence_powerman.py
index 962fdb8..7aeeaf1 100755
--- a/fence/agents/powerman/fence_powerman.py
+++ b/fence/agents/powerman/fence_powerman.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!@PYTHON@ -tt
import os
import time
from datetime import datetime
diff --git a/fence/agents/pve/fence_pve.py b/fence/agents/pve/fence_pve.py
index c11f8c1..21fbb2f 100755
--- a/fence/agents/pve/fence_pve.py
+++ b/fence/agents/pve/fence_pve.py
@@ -35,7 +35,7 @@ def get_power_status(conn, options):
options["--nodename"] = None
return status
else:
- cmd = "nodes/" + options["--nodename"] + "/qemu/" + options["--plug"] + "/status/current"
+ cmd = "nodes/" + options["--nodename"] + "/" + options["--vmtype"] +"/" + options["--plug"] + "/status/current"
result = send_cmd(options, cmd)
if type(result) is dict and "data" in result:
if type(result["data"]) is dict and "status" in result["data"]:
@@ -50,7 +50,7 @@ def set_power_status(conn, options):
'on' : "start",
'off': "stop"
}[options["--action"]]
- cmd = "nodes/" + options["--nodename"] + "/qemu/" + options["--plug"] + "/status/" + action
+ cmd = "nodes/" + options["--nodename"] + "/" + options["--vmtype"] +"/" + options["--plug"] + "/status/" + action
send_cmd(options, cmd, post={"skiplock":1})
@@ -63,7 +63,7 @@ def get_outlet_list(conn, options):
for node in nodes["data"]:
if type(node) is not dict or "node" not in node:
return None
- vms = send_cmd(options, "nodes/" + node["node"] + "/qemu")
+ vms = send_cmd(options, "nodes/" + node["node"] + "/" + options["--vmtype"])
if type(vms) is not dict or "data" not in vms or type(vms["data"]) is not list:
return None
for vm in vms["data"]:
@@ -142,8 +142,19 @@ def main():
"(Optional, will be automatically determined)",
"order": 2
}
+ all_opt["vmtype"] = {
+ "getopt" : ":",
+ "longopt" : "vmtype",
+ "default" : "qemu",
+ "help" : "--vmtype "
+ "Virtual machine type lxc or qemu (default: qemu)",
+ "required" : "1",
+ "shortdesc" : "Virtual machine type lxc or qemu. "
+ "(Default: qemu)",
+ "order": 2
+ }
- device_opt = ["ipaddr", "login", "passwd", "web", "port", "node_name"]
+ device_opt = ["ipaddr", "login", "passwd", "web", "port", "node_name", "vmtype"]
all_opt["login"]["required"] = "0"
all_opt["login"]["default"] = "root at pam"
diff --git a/tests/data/metadata/fence_pve.xml b/tests/data/metadata/fence_pve.xml
index 454be01..35c65ad 100644
--- a/tests/data/metadata/fence_pve.xml
+++ b/tests/data/metadata/fence_pve.xml
@@ -83,6 +83,11 @@
<content type="string" />
<shortdesc lang="en">Node on which machine is located. (Optional, will be automatically determined)</shortdesc>
</parameter>
+ <parameter name="vmtype" unique="0" required="1">
+ <getopt mixed="--vmtype" />
+ <content type="string" default="qemu" />
+ <shortdesc lang="en">Virtual machine type lxc or qemu. (Default: qemu)</shortdesc>
+ </parameter>
<parameter name="quiet" unique="0" required="0">
<getopt mixed="-q, --quiet" />
<content type="boolean" />
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/fence-agents.git
More information about the Debian-HA-Commits
mailing list