Hello community,
here is the log from the commit of package fence-agents for openSUSE:Factory checked in at 2015-07-02 22:50:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fence-agents (Old)
and /work/SRC/openSUSE:Factory/.fence-agents.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fence-agents"
Changes:
--------
--- /work/SRC/openSUSE:Factory/fence-agents/fence-agents.changes 2015-06-11 09:10:38.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.fence-agents.new/fence-agents.changes 2015-07-03 00:03:56.000000000 +0200
@@ -1,0 +2,17 @@
+Wed Jul 1 14:13:51 UTC 2015 - kgronlund@suse.com
+
+- Update to 4.0.19:
+ * New fence agent for Nova compute machines (thanks to Andrew
+ Beekhof and Fabio)
+ * Fixed issues with whitespaces in few fence agents (thanks to
+ Christoph Berg)
+ * User of RHEV-M can have less privileges with updated
+ fence_rhevm (thanks to Rik Theys)
+ * Verbose output now captures also text before command prompt is
+ found
+ * Support for HP Integrity Superdome X was added to fence_hpblade
+ (thanks to Han Pilmeyer)
+ * Fence agent for IBM z/VM now uses API that require less resource
+ of device
+
+-------------------------------------------------------------------
Old:
----
fence-agents-4.0.18.tar.xz
New:
----
fence-agents-4.0.19.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ fence-agents.spec ++++++
--- /var/tmp/diff_new_pack.QprzZh/_old 2015-07-03 00:03:56.000000000 +0200
+++ /var/tmp/diff_new_pack.QprzZh/_new 2015-07-03 00:03:56.000000000 +0200
@@ -22,7 +22,7 @@
Summary: Fence Agents for Pacemaker from RHCS
License: GPL-2.0 and LGPL-2.1
Group: Productivity/Clustering/HA
-Version: 4.0.18
+Version: 4.0.19
Release: 0
Url: https://github.com/ClusterLabs/fence-agents
Source0: %{name}-%{version}.tar.xz
++++++ fence-agents-4.0.18.tar.xz -> fence-agents-4.0.19.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.18/configure.ac new/fence-agents-4.0.19/configure.ac
--- old/fence-agents-4.0.18/configure.ac 2015-05-11 13:56:54.000000000 +0200
+++ new/fence-agents-4.0.19/configure.ac 2015-07-01 12:51:18.000000000 +0200
@@ -174,6 +174,7 @@
AC_PATH_PROG([SNMPWALK_PATH], [snmpwalk], [/usr/bin/snmpwalk])
AC_PATH_PROG([SNMPSET_PATH], [snmpset], [/usr/bin/snmpset])
AC_PATH_PROG([SNMPGET_PATH], [snmpget], [/usr/bin/snmpget])
+AC_PATH_PROG([NOVA_PATH], [nova], [/usr/bin/nova])
## do subst
@@ -274,6 +275,7 @@
fence/agents/brocade/Makefile
fence/agents/cisco_mds/Makefile
fence/agents/cisco_ucs/Makefile
+ fence/agents/compute/Makefile
fence/agents/docker/Makefile
fence/agents/drac/Makefile
fence/agents/drac5/Makefile
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.18/fence/agents/compute/Makefile.am new/fence-agents-4.0.19/fence/agents/compute/Makefile.am
--- old/fence-agents-4.0.18/fence/agents/compute/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/fence-agents-4.0.19/fence/agents/compute/Makefile.am 2015-07-01 12:51:18.000000000 +0200
@@ -0,0 +1,17 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+TARGET = fence_compute
+
+SRC = $(TARGET).py
+
+EXTRA_DIST = $(SRC)
+
+sbin_SCRIPTS = $(TARGET)
+
+man_MANS = $(TARGET).8
+
+FENCE_TEST_ARGS = -l test -p test -n 1
+
+include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fenceman.mk
+include $(top_srcdir)/make/agentpycheck.mk
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.18/fence/agents/compute/fence_compute.py new/fence-agents-4.0.19/fence/agents/compute/fence_compute.py
--- old/fence-agents-4.0.18/fence/agents/compute/fence_compute.py 1970-01-01 01:00:00.000000000 +0100
+++ new/fence-agents-4.0.19/fence/agents/compute/fence_compute.py 2015-07-01 12:51:18.000000000 +0200
@@ -0,0 +1,248 @@
+#!/usr/bin/python -tt
+
+import sys
+import time
+import atexit
+import logging
+import requests.exceptions
+
+sys.path.append("@FENCEAGENTSLIBDIR@")
+from fencing import *
+from fencing import fail_usage, is_executable, run_command, run_delay
+
+#BEGIN_VERSION_GENERATION
+RELEASE_VERSION="4.0.11"
+BUILD_DATE="(built Wed Nov 12 06:33:38 EST 2014)"
+REDHAT_COPYRIGHT="Copyright (C) Red Hat, Inc. 2004-2010 All rights reserved."
+#END_VERSION_GENERATION
+
+override_status = ""
+nova = None
+
+def get_power_status(_, options):
+ global override_status
+
+ status = "unknown"
+ logging.debug("get action: " + options["--action"])
+
+ if len(override_status):
+ logging.debug("Pretending we're " + override_status)
+ return override_status
+
+ if nova:
+ try:
+ services = nova.services.list(host=options["--plug"])
+
+ for service in services:
+ if service.binary == "nova-compute":
+ if service.state == "up":
+ status = "on"
+ elif service.state == "down":
+ status = "off"
+ else:
+ logging.debug("Unknown status detected from nova: " + service.state)
+ break
+ except ConnectionError as (err):
+ logging.warning("Nova connection failed: " + str(err))
+ return status
+
+# NOTE(sbauza); We mimic the host-evacuate module since it's only a contrib
+# module which is not stable
+def _server_evacuate(server, on_shared_storage):
+ success = True
+ error_message = ""
+ try:
+ nova.servers.evacuate(server=server['uuid'], on_shared_storage=on_shared_storage)
+ except Exception as e:
+ success = False
+ error_message = "Error while evacuating instance: %s" % e
+
+ return {
+ "server_uuid": server['uuid'],
+ "evacuate_accepted": success,
+ "error_message": error_message,
+ }
+
+def _host_evacuate(host, on_shared_storage):
+ hypervisors = nova.hypervisors.search(host, servers=True)
+ response = []
+ for hyper in hypervisors:
+ if hasattr(hyper, 'servers'):
+ for server in hyper.servers:
+ response.append(_server_evacuate(server, on_shared_storage))
+
+def set_attrd_status(host, status, options):
+ logging.debug("Setting fencing status for %s to %s" % (host, status))
+ run_command(options, "attrd_updater -p -n evacute -Q -N %s -v %s" % (host, status))
+
+def set_power_status(_, options):
+ global override_status
+
+ override_status = ""
+ logging.debug("set action: " + options["--action"])
+
+ if not nova:
+ return
+
+ if options["--action"] == "on":
+ if get_power_status(_, options) == "on":
+ nova.services.enable(options["--plug"], 'nova-compute')
+ else:
+ # Pretend we're 'on' so that the fencing library doesn't loop forever waiting for the node to boot
+ override_status = "on"
+ return
+
+ # need to wait for nova to update its internal status or we
+ # cannot call host-evacuate
+ while get_power_status(_, options) != "off":
+ # Loop forever if need be.
+ #
+ # Some callers (such as Pacemaker) will have a timer
+ # running and kill us if necessary
+ logging.debug("Waiting for nova to update it's internal state")
+ time.sleep(1)
+
+ if options["--no-shared-storage"] != "False":
+ on_shared_storage = False
+ else:
+ on_shared_storage = True
+
+ _host_evacuate(options["--plug"], on_shared_storage)
+ return
+
+def get_plugs_list(_, options):
+ result = {}
+
+ if nova:
+ hypervisors = nova.hypervisors.list()
+ for hypervisor in hypervisors:
+ longhost = hypervisor.hypervisor_hostname
+ if options["--action"] == "list" and options["--domain"] != "":
+ shorthost = longhost.replace("." + options["--domain"],
+ "")
+ result[shorthost] = ("", None)
+ else:
+ result[longhost] = ("", None)
+ return result
+
+
+def define_new_opts():
+ all_opt["endpoint-type"] = {
+ "getopt" : "e:",
+ "longopt" : "endpoint-type",
+ "help" : "-e, --endpoint-type=[endpoint] Nova Endpoint type (publicURL, internalURL, adminURL)",
+ "required" : "0",
+ "shortdesc" : "Nova Endpoint type",
+ "default" : "internalURL",
+ "order": 1,
+ }
+ all_opt["tenant-name"] = {
+ "getopt" : "t:",
+ "longopt" : "tenant-name",
+ "help" : "-t, --tenant-name=[tenant] Keystone Admin Tenant",
+ "required" : "0",
+ "shortdesc" : "Keystone Admin Tenant",
+ "default" : "",
+ "order": 1,
+ }
+ all_opt["auth-url"] = {
+ "getopt" : "k:",
+ "longopt" : "auth-url",
+ "help" : "-k, --auth-url=[tenant] Keystone Admin Auth URL",
+ "required" : "0",
+ "shortdesc" : "Keystone Admin Auth URL",
+ "default" : "",
+ "order": 1,
+ }
+ all_opt["domain"] = {
+ "getopt" : "d:",
+ "longopt" : "domain",
+ "help" : "-d, --domain=[string] DNS domain in which hosts live, useful when the cluster uses short names and nova uses FQDN",
+ "required" : "0",
+ "shortdesc" : "DNS domain in which hosts live",
+ "default" : "",
+ "order": 5,
+ }
+ all_opt["record-only"] = {
+ "getopt" : "",
+ "longopt" : "record-only",
+ "help" : "--record-only Record the target as needing evacuation but as yet do not intiate it",
+ "required" : "0",
+ "shortdesc" : "Only record the target as needing evacuation",
+ "default" : "False",
+ "order": 5,
+ }
+ all_opt["no-shared-storage"] = {
+ "getopt" : "",
+ "longopt" : "no-shared-storage",
+ "help" : "--no-shared-storage Disable functionality for shared storage",
+ "required" : "0",
+ "shortdesc" : "Disable functionality for dealing with shared storage",
+ "default" : "False",
+ "order": 5,
+ }
+
+def main():
+ global override_status
+ global nova
+ atexit.register(atexit_handler)
+
+ device_opt = ["login", "passwd", "tenant-name", "auth-url",
+ "no_login", "no_password", "port", "domain", "no-shared-storage", "endpoint-type",
+ "record-only"]
+ define_new_opts()
+ all_opt["shell_timeout"]["default"] = "180"
+
+ options = check_input(device_opt, process_input(device_opt))
+
+ docs = {}
+ docs["shortdesc"] = "Fence agent for nova compute nodes"
+ docs["longdesc"] = "fence_nova_host is a Nova fencing notification agent"
+ docs["vendorurl"] = ""
+
+ show_docs(options, docs)
+
+ run_delay(options)
+
+ try:
+ from novaclient import client as nova_client
+ except ImportError:
+ fail_usage("nova not found or not accessible")
+
+ # Potentially we should make this a pacemaker feature
+ if options["--action"] != "list" and options["--domain"] != "" and options.has_key("--plug"):
+ options["--plug"] = options["--plug"] + "." + options["--domain"]
+
+ if options["--record-only"] != "False":
+ if options["--action"] == "on":
+ set_attrd_status(options["--plug"], "no", options)
+ sys.exit(0)
+
+ elif options["--action"] in ["off", "reboot"]:
+ set_attrd_status(options["--plug"], "yes", options)
+ sys.exit(0)
+
+ elif options["--action"] in ["status", "monitor"]:
+ sys.exit(0)
+
+ # The first argument is the Nova client version
+ nova = nova_client.Client('2',
+ options["--username"],
+ options["--password"],
+ options["--tenant-name"],
+ options["--auth-url"],
+ endpoint_type=options["--endpoint-type"])
+
+ if options["--action"] in ["off", "reboot"]:
+ # Pretend we're 'on' so that the fencing library will always call set_power_status(off)
+ override_status = "on"
+
+ if options["--action"] == "on":
+ # Pretend we're 'off' so that the fencing library will always call set_power_status(on)
+ override_status = "off"
+
+ result = fence_action(None, options, set_power_status, get_power_status, get_plugs_list, None)
+ sys.exit(result)
+
+if __name__ == "__main__":
+ main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.18/fence/agents/hpblade/fence_hpblade.py new/fence-agents-4.0.19/fence/agents/hpblade/fence_hpblade.py
--- old/fence-agents-4.0.18/fence/agents/hpblade/fence_hpblade.py 2015-05-11 13:56:54.000000000 +0200
+++ new/fence-agents-4.0.19/fence/agents/hpblade/fence_hpblade.py 2015-07-01 12:51:18.000000000 +0200
@@ -3,31 +3,62 @@
#####
##
## The Following Agent Has Been Tested On:
-## * BladeSystem c7000 Enclosure
+## * HP BladeSystem c7000 Enclosure
+## * HP Integrity Superdome X (BL920s)
#####
import sys, re
+import pexpect, exceptions
import atexit
sys.path.append("@FENCEAGENTSLIBDIR@")
from fencing import *
from fencing import fail, EC_STATUS
#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New Bladecenter Agent - test release on steroids"
-REDHAT_COPYRIGHT=""
-BUILD_DATE="March, 2008"
+RELEASE_VERSION="4.0.11-HP"
+BUILD_DATE="(built Mon Mar 30 08:31:24 EDT 2015)"
+REDHAT_COPYRIGHT="Copyright (C) Red Hat, Inc. 2004-2010 All rights reserved."
#END_VERSION_GENERATION
+def get_enclosure_type(conn, options):
+ conn.send_eol("show enclosure info")
+ conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
+
+ type_re=re.compile(r"^\s*Enclosure Type: (\w+)(.*?)\s*$")
+ enclosure="unknown"
+ for line in conn.before.splitlines():
+ res = type_re.search(line)
+ if res != None:
+ enclosure=res.group(1)
+
+ if enclosure == "unknown":
+ fail(EC_GENERIC_ERROR)
+
+ return enclosure.lower().strip()
+
def get_power_status(conn, options):
- conn.send_eol("show server status " + options["--plug"])
- conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
+ if options["enc_type"] == "superdome":
+ cmd_send = "parstatus -M -p " + options["--plug"]
+ powrestr = "^partition:\\d\\s+:\\w+\\s+/(\\w+)\\s.*$"
+ else:
+ cmd_send = "show server status " + options["--plug"]
+ powrestr = "^\\s*Power: (.*?)\\s*$"
+
+ conn.send_eol(cmd_send)
+ conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
- power_re = re.compile(r"^\s*Power: (.*?)\s*$")
+ power_re = re.compile(powrestr)
status = "unknown"
for line in conn.before.splitlines():
res = power_re.search(line)
if res != None:
- status = res.group(1)
+ if options["enc_type"] == "superdome":
+ if res.group(1) == "DOWN":
+ status = "off"
+ else:
+ status = "on"
+ else:
+ status = res.group(1)
if status == "unknown":
if options.has_key("--missing-as-off"):
@@ -38,23 +69,37 @@
return status.lower().strip()
def set_power_status(conn, options):
+ if options["enc_type"] == "superdome":
+ dev="partition "
+ else:
+ dev="server "
+
if options["--action"] == "on":
- conn.send_eol("poweron server " + options["--plug"])
+ conn.send_eol("poweron " + dev + options["--plug"])
elif options["--action"] == "off":
- conn.send_eol("poweroff server " + options["--plug"] + " force")
- conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.send_eol("poweroff " + dev + options["--plug"] + " force")
+ conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
-def get_blades_list(conn, options):
+def get_instances_list(conn, options):
outlets = {}
+ if options["enc_type"] == "superdome":
+ cmd_send = "parstatus -P -M"
+ listrestr = "^partition:(\\d+)\\s+:\\w+\\s+/(\\w+)\\s+:OK.*?:(\\w+)\\s*$"
+ else:
+ cmd_send = "show server list"
+ listrestr = "^\\s*(\\d+)\\s+(.*?)\\s+(.*?)\\s+OK\\s+(.*?)\\s+(.*?)\\s*$"
- conn.send_eol("show server list")
- conn.log_expect(options["--command-prompt"], int(options["--shell-timeout"]))
+ conn.send_eol(cmd_send)
+ conn.log_expect(options, options["--command-prompt"], int(options["--shell-timeout"]))
- list_re = re.compile(r"^\s*(.*?)\s+(.*?)\s+(.*?)\s+OK\s+(.*?)\s+(.*?)\s*$")
+ list_re = re.compile(listrestr)
for line in conn.before.splitlines():
res = list_re.search(line)
if res != None:
- outlets[res.group(1)] = (res.group(2), res.group(4).lower())
+ if options["enc_type"] == "superdome":
+ outlets[res.group(1)] = (res.group(3), res.group(2).lower())
+ else:
+ outlets[res.group(1)] = (res.group(2), res.group(4).lower())
return outlets
@@ -65,14 +110,17 @@
atexit.register(atexit_handler)
all_opt["cmd_prompt"]["default"] = ["c7000oa>"]
+ all_opt["login_timeout"]["default"] = "10"
options = check_input(device_opt, process_input(device_opt))
docs = {}
docs["shortdesc"] = "Fence agent for HP BladeSystem"
docs["longdesc"] = "fence_hpblade is an I/O Fencing agent \
-which can be used with HP BladeSystem. It logs into an enclosure via telnet or ssh \
-and uses the command line interface to power on and off blades."
+which can be used with HP BladeSystem and HP Integrity Superdome X. \
+It logs into the onboard administrator of an enclosure via telnet or \
+ssh and uses the command line interface to power blades or partitions \
+on or off."
docs["vendorurl"] = "http://www.hp.com"
show_docs(options, docs)
@@ -81,7 +129,10 @@
######
options["eol"] = "\n"
conn = fence_login(options)
- result = fence_action(conn, options, set_power_status, get_power_status, get_blades_list)
+
+ options["enc_type"] = get_enclosure_type(conn, options)
+
+ result = fence_action(conn, options, set_power_status, get_power_status, get_instances_list)
fence_logout(conn, "exit")
sys.exit(result)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.18/fence/agents/lib/fencing.py.py new/fence-agents-4.0.19/fence/agents/lib/fencing.py.py
--- old/fence-agents-4.0.18/fence/agents/lib/fencing.py.py 2015-05-11 13:56:54.000000000 +0200
+++ new/fence-agents-4.0.19/fence/agents/lib/fencing.py.py 2015-07-01 12:51:18.000000000 +0200
@@ -759,10 +759,11 @@
## None as soon as all existing agent will support this operation
print "NOTICE: List option is not working on this device yet"
else:
- original_action = options["--action"]
+ options["--original-action"] = options["--action"]
options["--action"] = "list"
outlets = get_outlet_list(connection, options)
- options["--action"] = original_action
+ options["--action"] = options["--original-action"]
+ del options["--original-action"]
## keys can be numbers (port numbers) or strings (names of VM, UUID)
for outlet_id in outlets.keys():
@@ -865,9 +866,11 @@
conn = _login_ssh_with_identity_file(options)
else:
conn = _login_telnet(options, re_login_string)
- except pexpect.EOF:
+ except pexpect.EOF, exception:
+ logging.debug("%s", str(exception))
fail(EC_LOGIN_DENIED)
- except pexpect.TIMEOUT:
+ except pexpect.TIMEOUT, exception:
+ logging.debug("%s", str(exception))
fail(EC_LOGIN_DENIED)
return conn
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.18/fence/agents/lpar/fence_lpar.py new/fence-agents-4.0.19/fence/agents/lpar/fence_lpar.py
--- old/fence-agents-4.0.18/fence/agents/lpar/fence_lpar.py 2015-05-11 13:56:54.000000000 +0200
+++ new/fence-agents-4.0.19/fence/agents/lpar/fence_lpar.py 2015-07-01 12:51:18.000000000 +0200
@@ -144,8 +144,8 @@
if not options.has_key("--managed"):
fail_usage("Failed: You have to enter name of managed system")
- if options["--action"] == "validate-all":
- sys.exit(0)
+ if options["--action"] == "validate-all":
+ sys.exit(0)
##
## Operate the fencing device
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.18/fence/agents/mpath/fence_mpath.py new/fence-agents-4.0.19/fence/agents/mpath/fence_mpath.py
--- old/fence-agents-4.0.18/fence/agents/mpath/fence_mpath.py 2015-05-11 13:56:54.000000000 +0200
+++ new/fence-agents-4.0.19/fence/agents/mpath/fence_mpath.py 2015-07-01 12:51:18.000000000 +0200
@@ -231,8 +231,8 @@
if not "--key" in options:
fail_usage("Failed: key is required")
- if options["--action"] == "validate-all":
- sys.exit(0)
+ if options["--action"] == "validate-all":
+ sys.exit(0)
options["devices"] = options["--devices"].split(",")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.18/fence/agents/rhevm/fence_rhevm.py new/fence-agents-4.0.19/fence/agents/rhevm/fence_rhevm.py
--- old/fence-agents-4.0.18/fence/agents/rhevm/fence_rhevm.py 2015-05-11 13:56:54.000000000 +0200
+++ new/fence-agents-4.0.19/fence/agents/rhevm/fence_rhevm.py 2015-07-01 12:51:18.000000000 +0200
@@ -66,7 +66,8 @@
lines = res.split("