Hello community, here is the log from the commit of package fence-agents for openSUSE:Factory checked in at 2018-02-12 10:16:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fence-agents (Old) and /work/SRC/openSUSE:Factory/.fence-agents.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fence-agents" Mon Feb 12 10:16:05 2018 rev:36 rq:575475 version:4.0.25+git.1518188333.853850c3 Changes: -------- --- /work/SRC/openSUSE:Factory/fence-agents/fence-agents.changes 2018-02-07 18:42:58.123813224 +0100 +++ /work/SRC/openSUSE:Factory/.fence-agents.new/fence-agents.changes 2018-02-12 10:16:08.767491975 +0100 @@ -1,0 +2,6 @@ +Mon Feb 12 06:57:01 UTC 2018 - [email protected] + +- Update to version 4.0.25+git.1518188333.853850c3: + * heuristics_ping: fix for python3 TypeError + +------------------------------------------------------------------- Old: ---- fence-agents-4.0.25+git.1516265527.7ab202cf.tar.xz New: ---- fence-agents-4.0.25+git.1518188333.853850c3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fence-agents.spec ++++++ --- /var/tmp/diff_new_pack.CP0nt3/_old 2018-02-12 10:16:09.347471075 +0100 +++ /var/tmp/diff_new_pack.CP0nt3/_new 2018-02-12 10:16:09.351470931 +0100 @@ -23,7 +23,7 @@ Summary: Fence Agents for High Availability License: GPL-2.0 and LGPL-2.1 Group: Productivity/Clustering/HA -Version: 4.0.25+git.1516265527.7ab202cf +Version: 4.0.25+git.1518188333.853850c3 Release: 0 Url: https://github.com/ClusterLabs/fence-agents Source0: %{name}-%{version}.tar.xz ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.CP0nt3/_old 2018-02-12 10:16:09.407468913 +0100 +++ /var/tmp/diff_new_pack.CP0nt3/_new 2018-02-12 10:16:09.423468336 +0100 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/ClusterLabs/fence-agents.git</param> - <param name="changesrevision">24c8fe07b21ac07c65292195a044a230a5bd2579</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">6d2a8aad12e4a62441dd7ca78ae093960bc88dac</param></service></servicedata> \ No newline at end of file ++++++ fence-agents-4.0.25+git.1516265527.7ab202cf.tar.xz -> fence-agents-4.0.25+git.1518188333.853850c3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.25+git.1516265527.7ab202cf/fence/agents/heuristics_ping/fence_heuristics_ping.py new/fence-agents-4.0.25+git.1518188333.853850c3/fence/agents/heuristics_ping/fence_heuristics_ping.py --- old/fence-agents-4.0.25+git.1516265527.7ab202cf/fence/agents/heuristics_ping/fence_heuristics_ping.py 2018-01-18 09:52:07.000000000 +0100 +++ new/fence-agents-4.0.25+git.1518188333.853850c3/fence/agents/heuristics_ping/fence_heuristics_ping.py 2018-02-09 15:58:53.000000000 +0100 @@ -72,7 +72,7 @@ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.25+git.1516265527.7ab202cf/fence/agents/vmware_vcloud/fence_vmware_vcloud.py new/fence-agents-4.0.25+git.1518188333.853850c3/fence/agents/vmware_vcloud/fence_vmware_vcloud.py --- old/fence-agents-4.0.25+git.1516265527.7ab202cf/fence/agents/vmware_vcloud/fence_vmware_vcloud.py 1970-01-01 01:00:00.000000000 +0100 +++ new/fence-agents-4.0.25+git.1518188333.853850c3/fence/agents/vmware_vcloud/fence_vmware_vcloud.py 2018-02-09 15:58:53.000000000 +0100 @@ -0,0 +1,211 @@ +#!@PYTHON@ -tt + +import sys +import pycurl, io +import logging +import atexit +import xml.etree.ElementTree as etree +sys.path.append("@FENCEAGENTSLIBDIR@") +from fencing import * +from fencing import fail, run_delay, EC_LOGIN_DENIED, EC_STATUS + +state = {"POWERED_ON": "on", 'POWERED_OFF': "off", 'SUSPENDED': "off"} + +def get_power_status(conn, options): + try: + VM = send_command(conn, "vApp/vm-{}".format(options["--plug"])) + except Exception as e: + logging.debug("Failed: {}".format(e)) + fail(EC_STATUS) + + options["id"] = VM.attrib['href'].split('/vm-', 1)[1] + + if (VM.attrib['status'] == '3'): + return state['SUSPENDED'] + elif (VM.attrib['status'] == '4'): + return state['POWERED_ON'] + elif (VM.attrib['status'] == '8'): + return state['POWERED_OFF'] + return EC_STATUS + + +def set_power_status(conn, options): + action = { + "on" : "powerOn", + "off" : "powerOff", + "shutdown": "shutdown", + "suspend": "suspend", + "reset": "reset" + }[options["--action"]] + try: + VM = send_command(conn, "vApp/vm-{}/power/action/{}".format(options["--plug"], action), "POST") + except Exception as e: + logging.debug("Failed: {}".format(e)) + fail(EC_STATUS) + +def get_list(conn, options): + outlets = {} + + VMsResponse = send_command(conn, "vms/query") + + for VM in VMsResponse.iter('{http://www.vmware.com/vcloud/v1.5}VMRecord'): + if '/vApp/' not in VM.attrib['href']: + continue + uuid = (VM.attrib['href'].split('/vm-', 1))[1] + outlets['['+ uuid + '] ' + VM.attrib['containerName'] + '\\' + VM.attrib['name']] = (VM.attrib['status'], state[VM.attrib['status']]) + + return outlets + +def connect(opt): + conn = pycurl.Curl() + + ## setup correct URL + if "--ssl" in opt or "--ssl-secure" in opt or "--ssl-insecure" in opt: + conn.base_url = "https:" + else: + conn.base_url = "http:" + + conn.base_url += "//" + opt["--ip"] + ":" + str(opt["--ipport"]) + opt["--api-path"] + "/" + + ## send command through pycurl + conn.setopt(pycurl.HTTPHEADER, [ + "Accept: application/*+xml;version=1.5", + ]) + + conn.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_BASIC) + conn.setopt(pycurl.USERPWD, opt["--username"] + ":" + opt["--password"]) + + conn.setopt(pycurl.TIMEOUT, int(opt["--shell-timeout"])) + if "--ssl" in opt or "--ssl-secure" in opt: + conn.setopt(pycurl.SSL_VERIFYPEER, 1) + conn.setopt(pycurl.SSL_VERIFYHOST, 2) + elif "--ssl-insecure" in opt: + conn.setopt(pycurl.SSL_VERIFYPEER, 0) + conn.setopt(pycurl.SSL_VERIFYHOST, 0) + + headers = {} + try: + result = send_command(conn, "sessions", "POST", headers) + except Exception as e: + logging.debug("Failed: {}".format(e)) + fail(EC_LOGIN_DENIED) + + # set session id for later requests + conn.setopt(pycurl.HTTPHEADER, [ + "Accept: application/*+xml;version=1.5", + "x-vcloud-authorization: {}".format(headers['x-vcloud-authorization']), + ]) + + return conn + +def disconnect(conn): + send_command(conn, "session", "DELETE") + conn.close() + +def parse_headers(data): + headers = {} + data = data.split("\r\n") + for header_line in data[1:]: + if ':' not in header_line: + break + name, value = header_line.split(':', 1) + name = name.strip() + value = value.strip() + name = name.lower() + headers[name] = value + + return headers + +def send_command(conn, command, method="GET", headers={}): + url = conn.base_url + command + + conn.setopt(pycurl.URL, url.encode("ascii")) + + web_buffer = io.BytesIO() + headers_buffer = io.BytesIO() + + if method == "GET": + conn.setopt(pycurl.POST, 0) + elif method == "POST": + conn.setopt(pycurl.POSTFIELDS, "") + elif method == "DELETE": + conn.setopt(pycurl.CUSTOMREQUEST, "DELETE") + + conn.setopt(pycurl.WRITEFUNCTION, web_buffer.write) + conn.setopt(pycurl.HEADERFUNCTION, headers_buffer.write) + + try: + conn.perform() + except Exception as e: + raise Exception(e[1]) + + rc = conn.getinfo(pycurl.HTTP_CODE) + result = web_buffer.getvalue().decode() + headers.update(parse_headers(headers_buffer.getvalue().decode())) + + headers_buffer.close() + web_buffer.close() + + if len(result) > 0: + result = etree.fromstring(result) + + if rc != 200 and rc != 202 and rc != 204: + raise Exception("{}: {}".format(rc, result["value"]["messages"][0]["default_message"])) + + logging.debug("url: {}".format(url)) + logging.debug("method: {}".format(method)) + logging.debug("response code: {}".format(rc)) + logging.debug("result: {}\n".format(result)) + + return result + +def define_new_opts(): + all_opt["api_path"] = { + "getopt" : ":", + "longopt" : "api-path", + "help" : "--api-path=[path] The path part of the API URL", + "default" : "/api", + "required" : "0", + "shortdesc" : "The path part of the API URL", + "order" : 2} + +def main(): + device_opt = [ + "ipaddr", + "api_path", + "login", + "passwd", + "ssl", + "notls", + "web", + "port", + ] + + atexit.register(atexit_handler) + define_new_opts() + + all_opt["shell_timeout"]["default"] = "5" + all_opt["power_wait"]["default"] = "1" + + options = check_input(device_opt, process_input(device_opt)) + + docs = {} + docs["shortdesc"] = "Fence agent for VMware vCloud Director API" + docs["longdesc"] = "fence_vmware_vcloud is an I/O Fencing agent which can be used with VMware vCloud Director API to fence virtual machines." + docs["vendorurl"] = "https://www.vmware.com" + show_docs(options, docs) + + #### + ## Fence operations + #### + run_delay(options) + + conn = connect(options) + atexit.register(disconnect, conn) + + result = fence_action(conn, options, set_power_status, get_power_status, get_list) + + sys.exit(result) + +if __name__ == "__main__": + main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fence-agents-4.0.25+git.1516265527.7ab202cf/tests/data/metadata/fence_vmware_vcloud.xml new/fence-agents-4.0.25+git.1518188333.853850c3/tests/data/metadata/fence_vmware_vcloud.xml --- old/fence-agents-4.0.25+git.1516265527.7ab202cf/tests/data/metadata/fence_vmware_vcloud.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/fence-agents-4.0.25+git.1518188333.853850c3/tests/data/metadata/fence_vmware_vcloud.xml 2018-02-09 15:58:53.000000000 +0100 @@ -0,0 +1,181 @@ +<?xml version="1.0" ?> +<resource-agent name="fence_vmware_vcloud" shortdesc="Fence agent for VMware vCloud Director API" > +<longdesc>fence_vmware_vcloud is an I/O Fencing agent which can be used with VMware vCloud Director API to fence virtual machines.</longdesc> +<vendor-url>https://www.vmware.com</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="inet4_only" unique="0" required="0"> + <getopt mixed="-4, --inet4-only" /> + <content type="boolean" /> + <shortdesc lang="en">Forces agent to use IPv4 addresses only</shortdesc> + </parameter> + <parameter name="inet6_only" unique="0" required="0"> + <getopt mixed="-6, --inet6-only" /> + <content type="boolean" /> + <shortdesc lang="en">Forces agent to use IPv6 addresses only</shortdesc> + </parameter> + <parameter name="ip" unique="0" required="1" obsoletes="ipaddr"> + <getopt mixed="-a, --ip=[ip]" /> + <content type="string" /> + <shortdesc lang="en">IP address or hostname of fencing device</shortdesc> + </parameter> + <parameter name="ipaddr" unique="0" required="1" deprecated="1"> + <getopt mixed="-a, --ip=[ip]" /> + <content type="string" /> + <shortdesc lang="en">IP address or hostname of fencing device</shortdesc> + </parameter> + <parameter name="ipport" unique="0" required="0"> + <getopt mixed="-u, --ipport=[port]" /> + <content type="integer" default="80" /> + <shortdesc lang="en">TCP/UDP port to use for connection with device</shortdesc> + </parameter> + <parameter name="login" unique="0" required="1" deprecated="1"> + <getopt mixed="-l, --username=[name]" /> + <content type="string" /> + <shortdesc lang="en">Login name</shortdesc> + </parameter> + <parameter name="notls" unique="0" required="0"> + <getopt mixed="-t, --notls" /> + <content type="boolean" /> + <shortdesc lang="en">Disable TLS negotiation and force SSL3.0. This should only be used for devices that do not support TLS1.0 and up.</shortdesc> + </parameter> + <parameter name="passwd" unique="0" required="0" deprecated="1"> + <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" deprecated="1"> + <getopt mixed="-S, --password-script=[script]" /> + <content type="string" /> + <shortdesc lang="en">Script to run to retrieve password</shortdesc> + </parameter> + <parameter name="password" unique="0" required="0" obsoletes="passwd"> + <getopt mixed="-p, --password=[password]" /> + <content type="string" /> + <shortdesc lang="en">Login password or passphrase</shortdesc> + </parameter> + <parameter name="password_script" unique="0" required="0" obsoletes="passwd_script"> + <getopt mixed="-S, --password-script=[script]" /> + <content type="string" /> + <shortdesc lang="en">Script to run to retrieve password</shortdesc> + </parameter> + <parameter name="plug" unique="0" required="1" obsoletes="port"> + <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="port" unique="0" required="1" deprecated="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="ssl" unique="0" required="0"> + <getopt mixed="-z, --ssl" /> + <content type="boolean" /> + <shortdesc lang="en">Use SSL connection with verifying certificate</shortdesc> + </parameter> + <parameter name="ssl_insecure" unique="0" required="0"> + <getopt mixed="--ssl-insecure" /> + <content type="boolean" /> + <shortdesc lang="en">Use SSL connection without verifying certificate</shortdesc> + </parameter> + <parameter name="ssl_secure" unique="0" required="0"> + <getopt mixed="--ssl-secure" /> + <content type="boolean" /> + <shortdesc lang="en">Use SSL connection with verifying certificate</shortdesc> + </parameter> + <parameter name="username" unique="0" required="1" obsoletes="login"> + <getopt mixed="-l, --username=[name]" /> + <content type="string" /> + <shortdesc lang="en">Login name</shortdesc> + </parameter> + <parameter name="api_path" unique="0" required="0"> + <getopt mixed="--api-path=[path]" /> + <shortdesc lang="en">The path part of the API URL</shortdesc> + </parameter> + <parameter name="quiet" unique="0" required="0"> + <getopt mixed="-q, --quiet" /> + <content type="boolean" /> + <shortdesc lang="en">Disable logging to stderr. Does not affect --verbose or --debug-file or logging to syslog.</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" deprecated="1"> + <getopt mixed="-D, --debug-file=[debugfile]" /> + <content type="string" /> + <shortdesc lang="en">Write debug information to given file</shortdesc> + </parameter> + <parameter name="debug_file" unique="0" required="0" obsoletes="debug"> + <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="second" 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="second" 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="second" 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="second" default="1" /> + <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="second" default="5" /> + <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="integer" default="1" /> + <shortdesc lang="en">Count of attempts to retry power on</shortdesc> + </parameter> + <parameter name="gnutlscli_path" unique="0" required="0"> + <getopt mixed="--gnutlscli-path=[path]" /> + <shortdesc lang="en">Path to gnutls-cli binary</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>
