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 - [email protected] + +- 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("<vm ") for i in range(1, len(lines)): name = RE_GET_NAME.search(lines[i]).group(1) - outlets[name] = ("", None) + status = RE_STATUS.search(lines[i]).group(1) + outlets[name] = ("", status) except AttributeError: return {} except IndexError: @@ -87,7 +88,7 @@ conn = pycurl.Curl() web_buffer = StringIO.StringIO() conn.setopt(pycurl.URL, url) - conn.setopt(pycurl.HTTPHEADER, ["Content-type: application/xml", "Accept: application/xml", "Prefer: persistent-auth"]) + conn.setopt(pycurl.HTTPHEADER, ["Content-type: application/xml", "Accept: application/xml", "Prefer: persistent-auth", "Filter: true"]) if opt.has_key("cookie"): conn.setopt(pycurl.COOKIE, opt["cookie"]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.18/fence/agents/zvm/fence_zvmip.py new/fence-agents-4.0.19/fence/agents/zvm/fence_zvmip.py --- old/fence-agents-4.0.18/fence/agents/zvm/fence_zvmip.py 2015-05-11 13:56:54.000000000 +0200 +++ new/fence-agents-4.0.19/fence/agents/zvm/fence_zvmip.py 2015-07-01 12:51:18.000000000 +0200 @@ -62,24 +62,39 @@ def get_power_status(conn, options): del conn - # '*' = list all active images + if options.get("--original-action", None) == "monitor": + (return_code, reason_code, images_active) = \ + get_list_of_images(options, "Check_Authentication", None) + + logging.debug("Check_Authenticate (%d,%d)", return_code, reason_code) + if return_code == 0: + return {} + else: + fail(EC_LOGIN_DENIED) + + if options["--action"] == "list": + # '*' = list all active images + options["--plug"] = "*" + (return_code, reason_code, images_active) = \ - get_list_of_images(options, "Image_Status_Query", "*") + get_list_of_images(options, "Image_Status_Query", options["--plug"]) logging.debug("Image_Status_Query results are (%d,%d)", return_code, reason_code) - (return_code, reason_code, images_defined) = \ + + if not options["--action"] == "list": + if (return_code == 0) and (reason_code == 0): + return "on" + elif (return_code == 0) and (reason_code == 12): + # We are running always with --missing-as-off because we can not check if image + # is defined or not (look at rhbz#1188750) + return "off" + else: + return "unknown" + else: + (return_code, reason_code, images_defined) = \ get_list_of_images(options, "Image_Name_Query_DM", options["--username"]) - logging.debug("Image_Name_Query_DM results are (%d,%d)", return_code, reason_code) + logging.debug("Image_Name_Query_DM results are (%d,%d)", return_code, reason_code) - if ["list", "monitor"].count(options["--action"]) == 1: return dict([(i, ("", "on" if i in images_active else "off")) for i in images_defined]) - else: - status = "error" - if options["--plug"].upper() in images_defined: - if options["--plug"].upper() in images_active: - status = "on" - else: - status = "off" - return status def set_power_status(conn, options): conn = open_socket(options) @@ -101,7 +116,11 @@ def get_list_of_images(options, command, data_as_plug): conn = open_socket(options) - packet = prepare_smapi_command(options, command, [data_as_plug]) + if data_as_plug is None: + packet = prepare_smapi_command(options, command, []) + else: + packet = prepare_smapi_command(options, command, [data_as_plug]) + conn.send(packet) request_id = struct.unpack("!i", conn.recv(INT4))[0] @@ -133,19 +152,20 @@ return (return_code, reason_code, images) def main(): - device_opt = ["ipaddr", "login", "passwd", "port", "method"] + device_opt = ["ipaddr", "login", "passwd", "port", "method", "missing_as_off"] atexit.register(atexit_handler) all_opt["ipport"]["default"] = "44444" all_opt["shell_timeout"]["default"] = "5.0" + all_opt["missing_as_off"]["default"] = "1" options = check_input(device_opt, process_input(device_opt), other_conditions=True) if len(options.get("--plug", "")) > 8: fail_usage("Failed: Name of image can not be longer than 8 characters") - if options["--action"] == "validate-all": - sys.exit(0) + if options["--action"] == "validate-all": + sys.exit(0) docs = {} docs["shortdesc"] = "Fence agent for use with z/VM Virtual Machines" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.18/make/fencebuild.mk new/fence-agents-4.0.19/make/fencebuild.mk --- old/fence-agents-4.0.18/make/fencebuild.mk 2015-05-11 13:56:54.000000000 +0200 +++ new/fence-agents-4.0.19/make/fencebuild.mk 2015-07-01 12:51:18.000000000 +0200 @@ -24,6 +24,7 @@ -e 's#@''SNMPWALK_PATH@#${SNMPWALK_PATH}#g' \ -e 's#@''SNMPSET_PATH@#${SNMPSET_PATH}#g' \ -e 's#@''SNMPGET_PATH@#${SNMPGET_PATH}#g' \ + -e 's#@''NOVA_PATH@#${NOVA_PATH}#g' \ > $@ if [ 0 -eq `echo "$(SRC)" | grep fence_ &> /dev/null; echo $$?` ]; then \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.18/tests/data/metadata/fence_compute.xml new/fence-agents-4.0.19/tests/data/metadata/fence_compute.xml --- old/fence-agents-4.0.18/tests/data/metadata/fence_compute.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/fence-agents-4.0.19/tests/data/metadata/fence_compute.xml 2015-07-01 12:51:18.000000000 +0200 @@ -0,0 +1,128 @@ +<?xml version="1.0" ?> +<resource-agent name="fence_compute" shortdesc="Fence agent for nova compute nodes" > +<longdesc>fence_nova_host is a Nova fencing notification agent</longdesc> +<vendor-url></vendor-url> +<parameters> + <parameter name="action" unique="0" required="1"> + <getopt mixed="-o, --action=[action]" /> + <content type="string" default="reboot" /> + <shortdesc lang="en">Fencing action</shortdesc> + </parameter> + <parameter name="auth-url" unique="0" required="0"> + <getopt mixed="-k, --auth-url=[tenant]" /> + <content type="string" default="" /> + <shortdesc lang="en">Keystone Admin Auth URL</shortdesc> + </parameter> + <parameter name="endpoint-type" unique="0" required="0"> + <getopt mixed="-e, --endpoint-type=[endpoint]" /> + <content type="string" default="internalURL" /> + <shortdesc lang="en">Nova Endpoint type</shortdesc> + </parameter> + <parameter name="login" unique="0" required="0"> + <getopt mixed="-l, --username=[name]" /> + <content type="string" /> + <shortdesc lang="en">Login name</shortdesc> + </parameter> + <parameter name="passwd" unique="0" required="0"> + <getopt mixed="-p, --password=[password]" /> + <content type="string" /> + <shortdesc lang="en">Login password or passphrase</shortdesc> + </parameter> + <parameter name="passwd_script" unique="0" required="0"> + <getopt mixed="-S, --password-script=[script]" /> + <content type="string" /> + <shortdesc lang="en">Script to run to retrieve password</shortdesc> + </parameter> + <parameter name="port" unique="0" required="1"> + <getopt mixed="-n, --plug=[id]" /> + <content type="string" /> + <shortdesc lang="en">Physical plug number on device, UUID or identification of machine</shortdesc> + </parameter> + <parameter name="tenant-name" unique="0" required="0"> + <getopt mixed="-t, --tenant-name=[tenant]" /> + <content type="string" default="" /> + <shortdesc lang="en">Keystone Admin Tenant</shortdesc> + </parameter> + <parameter name="domain" unique="0" required="0"> + <getopt mixed="-d, --domain=[string]" /> + <content type="string" default="" /> + <shortdesc lang="en">DNS domain in which hosts live</shortdesc> + </parameter> + <parameter name="no-shared-storage" unique="0" required="0"> + <getopt mixed="--no-shared-storage" /> + <content type="boolean" default="False" /> + <shortdesc lang="en">Disable functionality for dealing with shared storage</shortdesc> + </parameter> + <parameter name="record-only" unique="0" required="0"> + <getopt mixed="--record-only" /> + <content type="boolean" default="False" /> + <shortdesc lang="en">Only record the target as needing evacuation</shortdesc> + </parameter> + <parameter name="verbose" unique="0" required="0"> + <getopt mixed="-v, --verbose" /> + <content type="boolean" /> + <shortdesc lang="en">Verbose mode</shortdesc> + </parameter> + <parameter name="debug" unique="0" required="0"> + <getopt mixed="-D, --debug-file=[debugfile]" /> + <content type="string" /> + <shortdesc lang="en">Write debug information to given file</shortdesc> + </parameter> + <parameter name="version" unique="0" required="0"> + <getopt mixed="-V, --version" /> + <content type="boolean" /> + <shortdesc lang="en">Display version information and exit</shortdesc> + </parameter> + <parameter name="help" unique="0" required="0"> + <getopt mixed="-h, --help" /> + <content type="boolean" /> + <shortdesc lang="en">Display help and exit</shortdesc> + </parameter> + <parameter name="separator" unique="0" required="0"> + <getopt mixed="-C, --separator=[char]" /> + <content type="string" default="," /> + <shortdesc lang="en">Separator for CSV created by 'list' operation</shortdesc> + </parameter> + <parameter name="delay" unique="0" required="0"> + <getopt mixed="--delay=[seconds]" /> + <content type="string" default="0" /> + <shortdesc lang="en">Wait X seconds before fencing is started</shortdesc> + </parameter> + <parameter name="login_timeout" unique="0" required="0"> + <getopt mixed="--login-timeout=[seconds]" /> + <content type="string" default="5" /> + <shortdesc lang="en">Wait X seconds for cmd prompt after login</shortdesc> + </parameter> + <parameter name="power_timeout" unique="0" required="0"> + <getopt mixed="--power-timeout=[seconds]" /> + <content type="string" default="20" /> + <shortdesc lang="en">Test X seconds for status change after ON/OFF</shortdesc> + </parameter> + <parameter name="power_wait" unique="0" required="0"> + <getopt mixed="--power-wait=[seconds]" /> + <content type="string" default="0" /> + <shortdesc lang="en">Wait X seconds after issuing ON/OFF</shortdesc> + </parameter> + <parameter name="shell_timeout" unique="0" required="0"> + <getopt mixed="--shell-timeout=[seconds]" /> + <content type="string" default="180" /> + <shortdesc lang="en">Wait X seconds for cmd prompt after issuing command</shortdesc> + </parameter> + <parameter name="retry_on" unique="0" required="0"> + <getopt mixed="--retry-on=[attempts]" /> + <content type="string" default="1" /> + <shortdesc lang="en">Count of attempts to retry power on</shortdesc> + </parameter> +</parameters> +<actions> + <action name="on" automatic="0"/> + <action name="off" /> + <action name="reboot" /> + <action name="status" /> + <action name="list" /> + <action name="list-status" /> + <action name="monitor" /> + <action name="metadata" /> + <action name="validate-all" /> +</actions> +</resource-agent> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.18/tests/data/metadata/fence_hpblade.xml new/fence-agents-4.0.19/tests/data/metadata/fence_hpblade.xml --- old/fence-agents-4.0.18/tests/data/metadata/fence_hpblade.xml 2015-05-11 13:56:54.000000000 +0200 +++ new/fence-agents-4.0.19/tests/data/metadata/fence_hpblade.xml 2015-07-01 12:51:18.000000000 +0200 @@ -1,6 +1,6 @@ <?xml version="1.0" ?> <resource-agent name="fence_hpblade" shortdesc="Fence agent for HP BladeSystem" > -<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.</longdesc> +<longdesc>fence_hpblade is an I/O Fencing agent 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.</longdesc> <vendor-url>http://www.hp.com</vendor-url> <parameters> <parameter name="action" unique="0" required="1"> @@ -100,7 +100,7 @@ </parameter> <parameter name="login_timeout" unique="0" required="0"> <getopt mixed="--login-timeout=[seconds]" /> - <content type="string" default="5" /> + <content type="string" default="10" /> <shortdesc lang="en">Wait X seconds for cmd prompt after login</shortdesc> </parameter> <parameter name="missing_as_off" unique="0" required="0"> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.18/tests/data/metadata/fence_zvmip.xml new/fence-agents-4.0.19/tests/data/metadata/fence_zvmip.xml --- old/fence-agents-4.0.18/tests/data/metadata/fence_zvmip.xml 2015-05-11 13:56:54.000000000 +0200 +++ new/fence-agents-4.0.19/tests/data/metadata/fence_zvmip.xml 2015-07-01 12:51:18.000000000 +0200 @@ -105,6 +105,11 @@ <content type="string" default="5" /> <shortdesc lang="en">Wait X seconds for cmd prompt after login</shortdesc> </parameter> + <parameter name="missing_as_off" unique="0" required="0"> + <getopt mixed="--missing-as-off" /> + <content type="boolean" default="1" /> + <shortdesc lang="en">Missing port returns OFF instead of failure</shortdesc> + </parameter> <parameter name="power_timeout" unique="0" required="0"> <getopt mixed="--power-timeout=[seconds]" /> <content type="string" default="20" />
