diff --git a/agents/ibmz/fence_ibmz.py b/agents/ibmz/fence_ibmz.py
new file mode 100644
index 00000000..d3ac550d
--- /dev/null
+++ b/agents/ibmz/fence_ibmz.py
@@ -0,0 +1,542 @@
+#!@PYTHON@ -tt
+
+# Copyright (c) 2020 IBM Corp.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library. If not, see
+# .
+
+import atexit
+import logging
+import time
+import sys
+
+import requests
+from requests.packages import urllib3
+
+sys.path.append("@FENCEAGENTSLIBDIR@")
+from fencing import *
+from fencing import fail_usage, run_delay, EC_GENERIC_ERROR
+
+DEFAULT_POWER_TIMEOUT = '300'
+ERROR_NOT_FOUND = ("{obj_type} {obj_name} not found in this HMC. "
+ "Attention: names are case-sensitive.")
+
+class ApiClientError(Exception):
+ """
+ Base exception for all API Client related errors.
+ """
+
+class ApiClientRequestError(ApiClientError):
+ """
+ Raised when an API request ends in error
+ """
+
+ def __init__(self, req_method, req_uri, status, reason, message):
+ self.req_method = req_method
+ self.req_uri = req_uri
+ self.status = status
+ self.reason = reason
+ self.message = message
+ super(ApiClientRequestError, self).__init__()
+
+ def __str__(self):
+ return (
+ "API request failed, details:\n"
+ "HTTP Request : {req_method} {req_uri}\n"
+ "HTTP Response status: {status}\n"
+ "Error reason: {reason}\n"
+ "Error message: {message}\n".format(
+ req_method=self.req_method, req_uri=self.req_uri,
+ status=self.status, reason=self.reason, message=self.message)
+ )
+
+class APIClient(object):
+ DEFAULT_CONFIG = {
+ # how many connection-related errors to retry on
+ 'connect_retries': 3,
+ # how many times to retry on read errors (after request was sent to the
+ # server)
+ 'read_retries': 3,
+ # http methods that should be retried
+ 'method_whitelist': ['HEAD', 'GET', 'OPTIONS'],
+ # limit of redirects to perform to avoid loops
+ 'redirect': 5,
+ # how long to wait while establishing a connection
+ 'connect_timeout': 30,
+ # how long to wait for asynchronous operations (jobs) to complete
+ 'operation_timeout': 900,
+ # how long to wait between bytes sent by the remote side
+ 'read_timeout': 300,
+ # default API port
+ 'port': 6794,
+ # validate ssl certificates
+ 'ssl_verify': False
+ }
+ LABEL_BY_OP_MODE = {
+ 'classic': {
+ 'nodes': 'logical-partitions',
+ 'state-on': 'operating',
+ 'start': 'load',
+ 'stop': 'deactivate'
+ },
+ 'dpm': {
+ 'nodes': 'partitions',
+ 'state-on': 'active',
+ 'start': 'start',
+ 'stop': 'stop'
+ }
+ }
+ def __init__(self, host, user, passwd, config=None):
+ self.host = host
+ if not passwd:
+ raise ValueError('Password cannot be empty')
+ self.passwd = passwd
+ if not user:
+ raise ValueError('Username cannot be empty')
+ self.user = user
+ self._cpc_cache = {}
+ self._session = None
+ self._config = self.DEFAULT_CONFIG.copy()
+ # apply user defined values
+ if config:
+ self._config.update(config)
+
+ def _create_session(self):
+ """
+ Create a new requests session and apply config values
+ """
+ session = requests.Session()
+ retry_obj = urllib3.Retry(
+ # setting a total is necessary to cover SSL related errors
+ total=max(self._config['connect_retries'],
+ self._config['read_retries']),
+ connect=self._config['connect_retries'],
+ read=self._config['read_retries'],
+ method_whitelist=self._config['method_whitelist'],
+ redirect=self._config['redirect']
+ )
+ session.mount('http://', requests.adapters.HTTPAdapter(
+ max_retries=retry_obj))
+ session.mount('https://', requests.adapters.HTTPAdapter(
+ max_retries=retry_obj))
+ return session
+
+ def _get_mode_labels(self, cpc):
+ """
+ Return the map of labels that corresponds to the cpc operation mode
+ """
+ if self.is_dpm_enabled(cpc):
+ return self.LABEL_BY_OP_MODE['dpm']
+ return self.LABEL_BY_OP_MODE['classic']
+
+ def _partition_switch_power(self, cpc, partition, action):
+ """
+ Perform the API request to start (power on) or stop (power off) the
+ target partition and wait for the job to finish.
+ """
+ # retrieve partition's uri
+ label_map = self._get_mode_labels(cpc)
+ resp = self._request('get', '{}/{}?name={}'.format(
+ self._cpc_cache[cpc]['object-uri'], label_map['nodes'], partition))
+
+ if not resp[label_map['nodes']]:
+ raise ValueError(ERROR_NOT_FOUND.format(
+ obj_type='LPAR/Partition', obj_name=partition))
+
+ part_uri = resp[label_map['nodes']][0]['object-uri']
+
+ # in dpm mode the request must have empty body
+ if self.is_dpm_enabled(cpc):
+ body = None
+ # in classic mode we make sure the operation is executed
+ # even if the partition is already on
+ else:
+ body = {'force': True}
+ # when powering on the partition must be activated first
+ if action == 'start':
+ op_uri = '{}/operations/activate'.format(part_uri)
+ job_resp = self._request(
+ 'post', op_uri, body=body, valid_codes=[202])
+ # always wait for activate otherwise the load (start)
+ # operation will fail
+ if self._config['operation_timeout'] == 0:
+ timeout = self.DEFAULT_CONFIG['operation_timeout']
+ else:
+ timeout = self._config['operation_timeout']
+ logging.debug(
+ 'waiting for activate (timeout %s secs)', timeout)
+ self._wait_for_job('post', op_uri, job_resp['job-uri'],
+ timeout=timeout)
+
+ # trigger the start job
+ op_uri = '{}/operations/{}'.format(part_uri, label_map[action])
+ job_resp = self._request('post', op_uri, body=body, valid_codes=[202])
+ if self._config['operation_timeout'] == 0:
+ return
+ logging.debug('waiting for %s (timeout %s secs)',
+ label_map[action], self._config['operation_timeout'])
+ self._wait_for_job('post', op_uri, job_resp['job-uri'],
+ timeout=self._config['operation_timeout'])
+
+ def _request(self, method, uri, body=None, headers=None, valid_codes=None):
+ """
+ Perform a request to the HMC API
+ """
+ assert method in ('delete', 'head', 'get', 'post', 'put')
+
+ url = 'https://{host}:{port}{uri}'.format(
+ host=self.host, port=self._config['port'], uri=uri)
+ if not headers:
+ headers = {}
+
+ if self._session is None:
+ raise ValueError('You need to log on first')
+ method = getattr(self._session, method)
+ timeout = (
+ self._config['connect_timeout'], self._config['read_timeout'])
+ response = method(url, json=body, headers=headers,
+ verify=self._config['ssl_verify'], timeout=timeout)
+
+ if valid_codes and response.status_code not in valid_codes:
+ reason = '(no reason)'
+ message = '(no message)'
+ if response.headers.get('content-type') == 'application/json':
+ try:
+ json_resp = response.json()
+ except ValueError:
+ pass
+ else:
+ reason = json_resp.get('reason', reason)
+ message = json_resp.get('message', message)
+ else:
+ message = '{}...'.format(response.text[:500])
+ raise ApiClientRequestError(
+ response.request.method, response.request.url,
+ response.status_code, reason, message)
+
+ if response.status_code == 204:
+ return dict()
+ try:
+ json_resp = response.json()
+ except ValueError:
+ raise ApiClientRequestError(
+ response.request.method, response.request.url,
+ response.status_code, '(no reason)',
+ 'Invalid JSON content in response')
+
+ return json_resp
+
+ def _update_cpc_cache(self, cpc_props):
+ self._cpc_cache[cpc_props['name']] = {
+ 'object-uri': cpc_props['object-uri'],
+ 'dpm-enabled': cpc_props.get('dpm-enabled', False)
+ }
+
+ def _wait_for_job(self, req_method, req_uri, job_uri, timeout):
+ """
+ Perform API requests to check for job status until it has completed
+ or the specified timeout is reached
+ """
+ op_timeout = time.time() + timeout
+ while time.time() < op_timeout:
+ job_resp = self._request("get", job_uri)
+ if job_resp['status'] == 'complete':
+ if job_resp['job-status-code'] in (200, 201, 204):
+ return
+ raise ApiClientRequestError(
+ req_method, req_uri,
+ job_resp.get('job-status-code', '(no status)'),
+ job_resp.get('job-reason-code', '(no reason)'),
+ job_resp.get('job-results', {}).get(
+ 'message', '(no message)')
+ )
+ time.sleep(1)
+ raise ApiClientError('Timed out while waiting for job completion')
+
+ def cpc_list(self):
+ """
+ Return a list of CPCs in the format {'name': 'cpc-name', 'status':
+ 'operating'}
+ """
+ list_resp = self._request("get", "/api/cpcs", valid_codes=[200])
+ ret = []
+ for cpc_props in list_resp['cpcs']:
+ self._update_cpc_cache(cpc_props)
+ ret.append({
+ 'name': cpc_props['name'], 'status': cpc_props['status']})
+ return ret
+
+ def is_dpm_enabled(self, cpc):
+ """
+ Return True if CPC is in DPM mode, False for classic mode
+ """
+ if cpc in self._cpc_cache:
+ return self._cpc_cache[cpc]['dpm-enabled']
+ list_resp = self._request("get", "/api/cpcs?name={}".format(cpc),
+ valid_codes=[200])
+ if not list_resp['cpcs']:
+ raise ValueError(ERROR_NOT_FOUND.format(
+ obj_type='CPC', obj_name=cpc))
+ self._update_cpc_cache(list_resp['cpcs'][0])
+ return self._cpc_cache[cpc]['dpm-enabled']
+
+ def logon(self):
+ """
+ Open a session with the HMC API and store its ID
+ """
+ self._session = self._create_session()
+ logon_body = {"userid": self.user, "password": self.passwd}
+ logon_resp = self._request("post", "/api/sessions", body=logon_body,
+ valid_codes=[200, 201])
+ self._session.headers["X-API-Session"] = logon_resp['api-session']
+
+ def logoff(self):
+ """
+ Close/delete the HMC API session
+ """
+ if self._session is None:
+ return
+ self._request("delete", "/api/sessions/this-session",
+ valid_codes=[204])
+ self._cpc_cache = {}
+ self._session = None
+
+ def partition_list(self, cpc):
+ """
+ Return a list of partitions in the format {'name': 'part-name',
+ 'status': 'on'}
+ """
+ label_map = self._get_mode_labels(cpc)
+ list_resp = self._request('get', '{}/{}'.format(
+ self._cpc_cache[cpc]['object-uri'], label_map['nodes']))
+ status_map = {label_map['state-on']: 'on'}
+ return [{'name': part['name'],
+ 'status': status_map.get(part['status'].lower(), 'off')}
+ for part in list_resp[label_map['nodes']]]
+
+ def partition_start(self, cpc, partition):
+ """
+ Power on a partition
+ """
+ self._partition_switch_power(cpc, partition, 'start')
+
+ def partition_status(self, cpc, partition):
+ """
+ Return the current status of a partition (on or off)
+ """
+ label_map = self._get_mode_labels(cpc)
+
+ resp = self._request('get', '{}/{}?name={}'.format(
+ self._cpc_cache[cpc]['object-uri'], label_map['nodes'], partition))
+ if not resp[label_map['nodes']]:
+ raise ValueError(ERROR_NOT_FOUND.format(
+ obj_type='LPAR/Partition', obj_name=partition))
+ part_props = resp[label_map['nodes']][0]
+ if part_props['status'].lower() == label_map['state-on']:
+ return 'on'
+ return 'off'
+
+ def partition_stop(self, cpc, partition):
+ """
+ Power off a partition
+ """
+ self._partition_switch_power(cpc, partition, 'stop')
+
+def parse_plug(options):
+ """
+ Extract cpc and partition from specified plug value
+ """
+ try:
+ cpc, partition = options['--plug'].strip().split('/', 1)
+ except ValueError:
+ fail_usage('Please specify nodename in format cpc/partition')
+ cpc = cpc.strip()
+ if not cpc or not partition:
+ fail_usage('Please specify nodename in format cpc/partition')
+ return cpc, partition
+
+def get_power_status(conn, options):
+ logging.debug('executing get_power_status')
+ status = conn.partition_status(*parse_plug(options))
+ return status
+
+def set_power_status(conn, options):
+ logging.debug('executing set_power_status')
+ if options['--action'] == 'on':
+ conn.partition_start(*parse_plug(options))
+ elif options['--action'] == 'off':
+ conn.partition_stop(*parse_plug(options))
+ else:
+ fail_usage('Invalid action {}'.format(options['--action']))
+
+def get_outlet_list(conn, options):
+ logging.debug('executing get_outlet_list')
+ result = {}
+ for cpc in conn.cpc_list():
+ for part in conn.partition_list(cpc['name']):
+ result['{}/{}'.format(cpc['name'], part['name'])] = (
+ part['name'], part['status'])
+ return result
+
+def disconnect(conn):
+ """
+ Close the API session
+ """
+ try:
+ conn.logoff()
+ except Exception as exc:
+ logging.exception('Logoff failed: ')
+ sys.exit(str(exc))
+
+def set_opts():
+ """
+ Define the options supported by this agent
+ """
+ device_opt = [
+ "ipaddr",
+ "ipport",
+ "login",
+ "passwd",
+ "port",
+ "connect_retries",
+ "connect_timeout",
+ "operation_timeout",
+ "read_retries",
+ "read_timeout",
+ "ssl_secure",
+ ]
+
+ all_opt["ipport"]["default"] = APIClient.DEFAULT_CONFIG['port']
+ all_opt["power_timeout"]["default"] = DEFAULT_POWER_TIMEOUT
+ port_desc = ("Physical plug id in the format cpc-name/partition-name "
+ "(case-sensitive)")
+ all_opt["port"]["shortdesc"] = port_desc
+ all_opt["port"]["help"] = (
+ "-n, --plug=[id] {}".format(port_desc))
+ all_opt["connect_retries"] = {
+ "getopt" : ":",
+ "longopt" : "connect-retries",
+ "help" : "--connect-retries=[number] How many times to "
+ "retry on connection errors",
+ "default" : APIClient.DEFAULT_CONFIG['connect_retries'],
+ "type" : "integer",
+ "required" : "0",
+ "shortdesc" : "How many times to retry on connection errors",
+ "order" : 2
+ }
+ all_opt["read_retries"] = {
+ "getopt" : ":",
+ "longopt" : "read-retries",
+ "help" : "--read-retries=[number] How many times to "
+ "retry on errors related to reading from server",
+ "default" : APIClient.DEFAULT_CONFIG['read_retries'],
+ "type" : "integer",
+ "required" : "0",
+ "shortdesc" : "How many times to retry on read errors",
+ "order" : 2
+ }
+ all_opt["connect_timeout"] = {
+ "getopt" : ":",
+ "longopt" : "connect-timeout",
+ "help" : "--connect-timeout=[seconds] How long to wait to "
+ "establish a connection",
+ "default" : APIClient.DEFAULT_CONFIG['connect_timeout'],
+ "type" : "second",
+ "required" : "0",
+ "shortdesc" : "How long to wait to establish a connection",
+ "order" : 2
+ }
+ all_opt["operation_timeout"] = {
+ "getopt" : ":",
+ "longopt" : "operation-timeout",
+ "help" : "--operation-timeout=[seconds] How long to wait for "
+ "power operation to complete (0 = do not wait)",
+ "default" : APIClient.DEFAULT_CONFIG['operation_timeout'],
+ "type" : "second",
+ "required" : "0",
+ "shortdesc" : "How long to wait for power operation to complete",
+ "order" : 2
+ }
+ all_opt["read_timeout"] = {
+ "getopt" : ":",
+ "longopt" : "read-timeout",
+ "help" : "--read-timeout=[seconds] How long to wait "
+ "to read data from server",
+ "default" : APIClient.DEFAULT_CONFIG['read_timeout'],
+ "type" : "second",
+ "required" : "0",
+ "shortdesc" : "How long to wait for server data",
+ "order" : 2
+ }
+ return device_opt
+
+def main():
+ """
+ Agent entry point
+ """
+ # register exit handler used by pacemaker
+ atexit.register(atexit_handler)
+
+ # prepare accepted options
+ device_opt = set_opts()
+
+ # parse options provided on input
+ options = check_input(device_opt, process_input(device_opt))
+
+ docs = {
+ "shortdesc": "Fence agent for IBM z LPARs",
+ "longdesc": (
+ "fence_ibmz is a power fencing agent which uses the HMC Web "
+ "Services API to fence IBM z LPARs."),
+ "vendorurl": "http://www.ibm.com"
+ }
+ show_docs(options, docs)
+
+ run_delay(options)
+
+ # set underlying library's logging and ssl config according to specified
+ # options
+ requests_log = logging.getLogger("urllib3")
+ requests_log.propagate = True
+ if "--verbose" in options:
+ requests_log.setLevel(logging.DEBUG)
+ if "--ssl-secure" not in options:
+ urllib3.disable_warnings(
+ category=urllib3.exceptions.InsecureRequestWarning)
+
+ hmc_address = options["--ip"]
+ hmc_userid = options["--username"]
+ hmc_password = options["--password"]
+ config = {
+ 'connect_retries': int(options['--connect-retries']),
+ 'read_retries': int(options['--read-retries']),
+ 'operation_timeout': int(options['--operation-timeout']),
+ 'connect_timeout': int(options['--connect-timeout']),
+ 'read_timeout': int(options['--read-timeout']),
+ 'port': int(options['--ipport']),
+ 'ssl_verify': bool('--ssl-secure' in options),
+ }
+ try:
+ conn = APIClient(hmc_address, hmc_userid, hmc_password, config)
+ conn.logon()
+ atexit.register(disconnect, conn)
+ result = fence_action(conn, options, set_power_status,
+ get_power_status, get_outlet_list)
+ except Exception:
+ logging.exception('Exception occurred: ')
+ result = EC_GENERIC_ERROR
+ sys.exit(result)
+
+if __name__ == "__main__":
+ main()
diff --git a/doc/COPYRIGHT b/doc/COPYRIGHT
index 0c6d6568..cad95eac 100644
--- a/doc/COPYRIGHT
+++ b/doc/COPYRIGHT
@@ -1,74 +1,78 @@
Unless specified otherwise in the "exceptions section" below:
Copyright (C) 1997-2003 Sistina Software, Inc. All rights reserved.
Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
Exceptions:
+agents/ibmz/*:
+ Copyright (c) 2020 IBM Corp.
+ Contributed by Paulo de Rezende Pinatti
+
agents/hds_cb/*:
Copyright (C) 2012 Matthew Clark.
Author: Matthew Clark
agents/xenapi/*:
Copyright (C) 2011 Matthew Clark.
Author: Matthew Clark
agents/apc_snmp/powernet369.mib:
Copyright (c) 2005 American Power Conversion, Inc.
PowerNet is a Trademark of American Power Conversion Corp.
agents/eaton_snmp/fence_eaton_snmp.py:
Copyright (c) 2011 eaton.com
Author: Arnaud Quette
agents/ifmib/fence_ifmib.py:
Copyright (C) 2008-2011 Ross Vandegrift.
Written by Ross Vandegrift
agents/intelmodular/fence_intelmodular.pl:
Contributed by Matthew Kent
agents/ipmilan/expect.{c,h}:
Copyright (C) 2000 Alan Robertson
agents/node_assassin/*
Copyright (C) 2009-2011 Madison Kelly/Alteeve's Niche!
Author: Digimer
man/fence_ifmib.8:
Copyright (C) 2008-2011 Ross Vandegrift.
Written by Ross Vandegrift
Authors as known by current RCS as of the time of writing:
Abhijith Das
Adam Manthei
A. J. Lewis
Alasdair G. Kergon
Andrew Price
Benjamin Marzinski
Bob Peterson
Chris Feist
Christine Caulfield
Daniel Phillips
David Teigland
Fabio M. Di Nitto
James Parsons
Joel Becker
Jonathan Brassow
jparsons
Ken Preslan
Klaus Wenninger
Lon Hohberger
Marc - A. Dahlhaus
Marek 'marx' Grac
Mark Hlawatschek
Michael Conrad Tadpol Tilstra
Patrick Caulfield
Robert Peterson
Ross Vandegrift
Ryan McCabe
Ryan O'Hara
Stanko Kupcevic
Steven Whitehouse
Wendy Cheng
diff --git a/fence-agents.spec.in b/fence-agents.spec.in
index 1a21b6c3..3b9fed7d 100644
--- a/fence-agents.spec.in
+++ b/fence-agents.spec.in
@@ -1,1061 +1,1079 @@
###############################################################################
###############################################################################
##
## Copyright (C) 2019 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
## of the GNU General Public License v.2.
##
###############################################################################
###############################################################################
%global rcver @rcver@
%global alphatag @alphatag@
%global numcomm @numcomm@
%global dirty @dirty@
Name: fence-agents
Summary: Set of unified programs capable of host isolation ("fencing")
Version: @version@
Release: @specver@%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
License: GPLv2+ and LGPLv2+
Group: System Environment/Base
URL: https://github.com/ClusterLabs/fence-agents
Source0: %{name}-%{version}%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}.tar.bz2
%if 0%{?rhel} == 7
%ifarch s390x
%define rhel7_s390x 1
%endif
%endif
# skipped: pve, raritan, rcd-serial, virsh
%global allfenceagents %(cat < 7 || 0%{?rhel} > 7 || 0%{?suse_version}
BuildRequires: python3-devel
BuildRequires: python3-pexpect python3-pycurl python3-requests
BuildRequires: python3-suds
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7
BuildRequires: python3-google-api-client python3-boto3 openwsman-python3
%endif
# (-openstack)
%ifarch x86_64 ppc64le
BuildRequires: python3-novaclient python3-keystoneclient
%endif
%if 0%{?suse_version}
BuildRequires: python3-google-api-python-client python3-openwsman python3-boto3
%endif
%else
BuildRequires: python-devel
BuildRequires: pexpect python-pycurl python-requests
BuildRequires: python-suds openwsman-python
%if ! %{defined rhel7_s390x}
BuildRequires: python-google-api-client python-boto3
%endif
# (-openstack)
%ifarch x86_64 ppc64le
BuildRequires: python-novaclient python-keystoneclient
%endif
%endif
# turn off the brp-python-bytecompile script
# (for F28+ or equivalent, the latter is the preferred form)
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompilespace:.*$!!g')
#undefine __brp_python_bytecompile
%prep
%setup -q -n %{name}-%{version}%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
%autopatch -p1
# prevent compilation of something that won't get used anyway
sed -i.orig 's|FENCE_ZVM=1|FENCE_ZVM=0|' configure.ac
%build
if [ -z "$PYTHON " ]; then
PYTHON="%{__python3}"
fi
./autogen.sh
%{configure}
CFLAGS="$(echo '%{optflags}')" make %{_smp_mflags}
%install
make install DESTDIR=%{buildroot}
# bytecompile Python source code in a non-standard location
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7
%py_byte_compile %{__python3} %{buildroot}%{_datadir}/fence
%endif
# XXX unsure if /usr/sbin/fence_* should be compiled as well
## tree fix up
# fix libfence permissions
chmod 0755 %{buildroot}%{_datadir}/fence/*.py
# remove docs
rm -rf %{buildroot}/usr/share/doc/fence-agents
%post
ccs_update_schema > /dev/null 2>&1 ||:
%description
A collection of executables to handle isolation ("fencing") of possibly
misbehaving hosts by the means of remote power management, blocking
network, storage, or similar. They operate through a unified interface
(calling conventions) devised for the original Red Hat clustering solution.
%package common
License: GPLv2+ and LGPLv2+
Summary: Common base for Fence Agents
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
Requires: python3-pexpect python3-pycurl
%else
Requires: pexpect python-pycurl
%endif
BuildArch: noarch
%description common
A collection of executables to handle isolation ("fencing") of possibly
misbehaving hosts by the means of remote power management, blocking
network, storage, or similar.
This package contains support files including the Python fencing library.
%files common
%doc doc/COPYING.* doc/COPYRIGHT doc/README.licence
%{_datadir}/fence
%exclude %{_datadir}/fence/azure_fence.*
%exclude %{_datadir}/fence/__pycache__/azure_fence.*
%exclude %{_datadir}/fence/XenAPI.*
%exclude %{_datadir}/fence/__pycache__/XenAPI.*
%{_datadir}/cluster
%exclude %{_datadir}/cluster/fence_scsi_check*
%exclude %{_sbindir}/*
%exclude %{_mandir}/man8/*
%package all
License: GPLv2+, LGPLv2+ and ASL 2.0
Summary: Set of unified programs capable of host isolation ("fencing")
Requires: %{allfenceagents}
Provides: fence-agents = %{version}-%{release}
Obsoletes: fence-agents < 3.1.13
%if 0%{?fedora} || 0%{?centos} || 0%{?rhel} > 7 || 0%{?suse_version}
BuildArch: noarch
%endif
%description all
A collection of executables to handle isolation ("fencing") of possibly
misbehaving hosts by the means of remote power management, blocking
network, storage, or similar.
This package serves as a catch-all for all supported fence agents.
%files all
%package alom
License: GPLv2+ and LGPLv2+
Summary: Fence agent for SUN ALOM
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description alom
Fence agent for SUN ALOM.
%files alom
%{_sbindir}/fence_alom
%{_mandir}/man8/fence_alom.8*
%package amt
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Intel AMT devices
Requires: amtterm
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description amt
Fence agent for AMT compatibile devices that are accessed via
3rd party software.
%files amt
%{_sbindir}/fence_amt
%{_mandir}/man8/fence_amt.8*
%package amt-ws
License: ASL 2.0
Summary: Fence agent for Intel AMT (WS-Man) devices
Requires: fence-agents-common = %{version}-%{release}
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7
Requires: openwsman-python3
%endif
%if 0%{?suse_version}
Requires: python3-openwsman
%endif
%else
Requires: openwsman-python
%endif
BuildArch: noarch
%description amt-ws
Fence agent for AMT (WS-Man) devices.
%files amt-ws
%{_sbindir}/fence_amt_ws
%{_mandir}/man8/fence_amt_ws.8*
%package apc
License: GPLv2+ and LGPLv2+
Summary: Fence agent for APC devices
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description apc
Fence agent for APC devices that are accessed via telnet or SSH.
%files apc
%{_sbindir}/fence_apc
%{_mandir}/man8/fence_apc.8*
%package apc-snmp
License: GPLv2+ and LGPLv2+
Summary: Fence agents for APC devices (SNMP)
Requires: net-snmp-utils
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description apc-snmp
Fence agents for APC devices that are accessed via the SNMP protocol.
%files apc-snmp
%{_sbindir}/fence_apc_snmp
%{_mandir}/man8/fence_apc_snmp.8*
%{_sbindir}/fence_tripplite_snmp
%{_mandir}/man8/fence_tripplite_snmp.8*
%if ! %{defined rhel7_s390x}
%package aws
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Amazon AWS
Requires: fence-agents-common = %{version}-%{release}
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
Requires: python3-boto3
%else
Requires: python-boto3
%endif
BuildArch: noarch
Obsoletes: fence-agents
%description aws
Fence agent for Amazon AWS instances.
%files aws
%{_sbindir}/fence_aws
%{_mandir}/man8/fence_aws.8*
%endif
%package azure-arm
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Azure Resource Manager
Requires: fence-agents-common = %{version}-%{release}
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
Requires: python3-azure-sdk
%else
Requires: python-azure-sdk
%endif
BuildArch: noarch
Obsoletes: fence-agents
%description azure-arm
Fence agent for Azure Resource Manager instances.
%files azure-arm
%{_sbindir}/fence_azure_arm
%{_datadir}/fence/azure_fence.py*
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7
%{_datadir}/fence/__pycache__/azure_fence.*
%endif
%{_mandir}/man8/fence_azure_arm.8*
%package bladecenter
License: GPLv2+ and LGPLv2+
Summary: Fence agent for IBM BladeCenter
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description bladecenter
Fence agent for IBM BladeCenter devices that are accessed
via telnet or SSH.
%files bladecenter
%{_sbindir}/fence_bladecenter
%{_mandir}/man8/fence_bladecenter.8*
%package brocade
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Brocade switches
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description brocade
Fence agent for Brocade devices that are accessed via telnet or SSH.
%files brocade
%{_sbindir}/fence_brocade
%{_mandir}/man8/fence_brocade.8*
%package cisco-mds
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Cisco MDS 9000 series
Requires: net-snmp-utils
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description cisco-mds
Fence agent for Cisco MDS 9000 series devices that are accessed
via the SNMP protocol.
%files cisco-mds
%{_sbindir}/fence_cisco_mds
%{_mandir}/man8/fence_cisco_mds.8*
%package cisco-ucs
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Cisco UCS series
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
Requires: python3-pycurl
%else
Requires: python-pycurl
%endif
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description cisco-ucs
Fence agent for Cisco UCS series devices that are accessed
via the SNMP protocol.
%files cisco-ucs
%{_sbindir}/fence_cisco_ucs
%{_mandir}/man8/fence_cisco_ucs.8*
%ifarch x86_64 ppc64le
%package compute
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Nova compute nodes
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
Requires: python3-requests
Requires: python3-novaclient
%else
Requires: python-requests
Requires: python2-novaclient
%endif
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description compute
Fence agent for Nova compute nodes.
%files compute
%{_sbindir}/fence_compute
%{_sbindir}/fence_evacuate
%{_mandir}/man8/fence_compute.8*
%{_mandir}/man8/fence_evacuate.8*
%endif
%package docker
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Docker
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
Requires: python3-pycurl
%else
Requires: python-pycurl
%endif
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description docker
Fence agent for Docker images that are accessed over HTTP.
%files docker
%{_sbindir}/fence_docker
%{_mandir}/man8/fence_docker.8*
%package drac
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Dell DRAC
Requires: telnet
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description drac
Fence agent for Dell DRAC IV series devices that are accessed
via telnet.
%files drac
%{_sbindir}/fence_drac
%{_mandir}/man8/fence_drac.8*
%package drac5
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Dell DRAC 5
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description drac5
Fence agent for Dell DRAC 5 series devices that are accessed
via telnet or SSH.
%files drac5
%{_sbindir}/fence_drac5
%{_mandir}/man8/fence_drac5.8*
%package eaton-snmp
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Eaton network power switches
Requires: net-snmp-utils
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description eaton-snmp
Fence agent for Eaton network power switches that are accessed
via the SNMP protocol.
%files eaton-snmp
%{_sbindir}/fence_eaton_snmp
%{_mandir}/man8/fence_eaton_snmp.8*
%package emerson
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Emerson devices (SNMP)
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description emerson
Fence agent for Emerson devices that are accessed via
the SNMP protocol.
%files emerson
%{_sbindir}/fence_emerson
%{_mandir}/man8/fence_emerson.8*
%package eps
License: GPLv2+ and LGPLv2+
Summary: Fence agent for ePowerSwitch 8M+ power switches
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description eps
Fence agent for ePowerSwitch 8M+ power switches that are accessed
via the HTTP(s) protocol.
%files eps
%{_sbindir}/fence_eps
%{_mandir}/man8/fence_eps.8*
%if ! %{defined rhel7_s390x}
%package gce
License: GPLv2+ and LGPLv2+
Summary: Fence agent for GCE (Google Cloud Engine)
Requires: fence-agents-common = %{version}-%{release}
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7
Requires: python3-google-api-client
%endif
%if 0%{?suse_version}
Requires: python3-google-api-python-client
%endif
%else
Requires: python-google-api-client
%endif
BuildArch: noarch
Obsoletes: fence-agents
%description gce
Fence agent for GCE (Google Cloud Engine) instances.
%files gce
%{_sbindir}/fence_gce
%{_mandir}/man8/fence_gce.8*
%endif
%package hds-cb
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Hitachi Compute Blade systems
Requires: telnet
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description hds-cb
Fence agent for Hitachi Compute Blades that are accessed via telnet.
%files hds-cb
%{_sbindir}/fence_hds_cb
%{_mandir}/man8/fence_hds_cb.8*
%package heuristics-ping
License: GPLv2+ and LGPLv2+
Summary: Pseudo fence agent to affect other agents based on ping-heuristics
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
Obsoletes: fence-agents
%description heuristics-ping
Fence pseudo agent used to affect other agents based on
ping-heuristics.
%files heuristics-ping
%{_sbindir}/fence_heuristics_ping
%{_mandir}/man8/fence_heuristics_ping.8*
%package hpblade
License: GPLv2+ and LGPLv2+
Summary: Fence agent for HP BladeSystem devices
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description hpblade
Fence agent for HP BladeSystem devices that are accessed via telnet
or SSH.
%files hpblade
%{_sbindir}/fence_hpblade
%{_mandir}/man8/fence_hpblade.8*
%package ibmblade
License: GPLv2+ and LGPLv2+
Summary: Fence agent for IBM BladeCenter
Requires: net-snmp-utils
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description ibmblade
Fence agent for IBM BladeCenter devices that are accessed
via the SNMP protocol.
%files ibmblade
%{_sbindir}/fence_ibmblade
%{_mandir}/man8/fence_ibmblade.8*
+%package ibmz
+License: GPLv2+ and LGPLv2+
+Summary: Fence agent for IBM z LPARs
+%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
+Requires: python3-requests
+%else
+Requires: python-requests
+%endif
+Requires: fence-agents-common = %{version}-%{release}
+BuildArch: noarch
+%description ibmz
+Fence agent for IBM z LPARs that are accessed via the HMC
+Web Services REST API.
+%files ibmz
+%{_sbindir}/fence_z
+%{_mandir}/man8/fence_z.8*
+
%package ifmib
License: GPLv2+ and LGPLv2+
Summary: Fence agent for devices with IF-MIB interfaces
Requires: net-snmp-utils
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description ifmib
Fence agent for IF-MIB interfaces that are accessed via
the SNMP protocol.
%files ifmib
%{_sbindir}/fence_ifmib
%{_mandir}/man8/fence_ifmib.8*
%package ilo2
License: GPLv2+ and LGPLv2+
Summary: Fence agents for HP iLO2 devices
Requires: gnutls-utils
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description ilo2
Fence agents for HP iLO2 devices that are accessed via
the HTTP(s) protocol.
%files ilo2
%{_sbindir}/fence_ilo
%{_sbindir}/fence_ilo2
%{_mandir}/man8/fence_ilo.8*
%{_mandir}/man8/fence_ilo2.8*
%package ilo-moonshot
License: GPLv2+ and LGPLv2+
Summary: Fence agent for HP iLO Moonshot devices
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description ilo-moonshot
Fence agent for HP iLO Moonshot devices that are accessed
via telnet or SSH.
%files ilo-moonshot
%{_sbindir}/fence_ilo_moonshot
%{_mandir}/man8/fence_ilo_moonshot.8*
%package ilo-mp
License: GPLv2+ and LGPLv2+
Summary: Fence agent for HP iLO MP devices
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description ilo-mp
Fence agent for HP iLO MP devices that are accessed via telnet or SSH.
%files ilo-mp
%{_sbindir}/fence_ilo_mp
%{_mandir}/man8/fence_ilo_mp.8*
%package ilo-ssh
License: GPLv2+ and LGPLv2+
Summary: Fence agents for HP iLO devices over SSH
Requires: openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description ilo-ssh
Fence agents for HP iLO devices that are accessed via telnet or SSH.
%files ilo-ssh
%{_sbindir}/fence_ilo_ssh
%{_mandir}/man8/fence_ilo_ssh.8*
%{_sbindir}/fence_ilo3_ssh
%{_mandir}/man8/fence_ilo3_ssh.8*
%{_sbindir}/fence_ilo4_ssh
%{_mandir}/man8/fence_ilo4_ssh.8*
%{_sbindir}/fence_ilo5_ssh
%{_mandir}/man8/fence_ilo5_ssh.8*
%package intelmodular
License: GPLv2+ and LGPLv2+
Summary: Fence agent for devices with Intel Modular interfaces
Requires: net-snmp-utils
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description intelmodular
Fence agent for Intel Modular interfaces that are accessed
via the SNMP protocol.
%files intelmodular
%{_sbindir}/fence_intelmodular
%{_mandir}/man8/fence_intelmodular.8*
%package ipdu
License: GPLv2+ and LGPLv2+
Summary: Fence agent for IBM iPDU network power switches
Requires: net-snmp-utils
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description ipdu
Fence agent for IBM iPDU network power switches that are accessed
via the SNMP protocol.
%files ipdu
%{_sbindir}/fence_ipdu
%{_mandir}/man8/fence_ipdu.8*
%package ipmilan
License: GPLv2+ and LGPLv2+
Summary: Fence agents for devices with IPMI interface
Requires: /usr/bin/ipmitool
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description ipmilan
Fence agents for devices with IPMI interface.
%files ipmilan
%{_sbindir}/fence_ipmilan
%{_mandir}/man8/fence_ipmilan.8*
%{_sbindir}/fence_idrac
%{_mandir}/man8/fence_idrac.8*
%{_sbindir}/fence_ilo3
%{_mandir}/man8/fence_ilo3.8*
%{_sbindir}/fence_ilo4
%{_mandir}/man8/fence_ilo4.8*
%{_sbindir}/fence_ilo5
%{_mandir}/man8/fence_ilo5.8*
%{_sbindir}/fence_imm
%{_mandir}/man8/fence_imm.8*
%ifarch x86_64 ppc64le
%package ironic
License: GPLv2+ and LGPLv2+
Summary: Fence agent for OpenStack's Ironic (Bare Metal as a service)
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description ironic
Fence agent for OpenStack's Ironic (Bare Metal as a service) service.
%files ironic
%{_sbindir}/fence_ironic
%{_mandir}/man8/fence_ironic.8*
%endif
%package kdump
License: GPLv2+ and LGPLv2+
Summary: Fence agent for use with kdump crash recovery service
Requires: fence-agents-common = %{version}-%{release}
# this cannot be noarch since it's compiled
%description kdump
Fence agent for use with kdump crash recovery service.
%files kdump
%{_sbindir}/fence_kdump
%{_libexecdir}/fence_kdump_send
%{_mandir}/man8/fence_kdump.8*
%{_mandir}/man8/fence_kdump_send.8*
%package ldom
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Sun LDom virtual machines
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description ldom
Fence agent for APC devices that are accessed via telnet or SSH.
%files ldom
%{_sbindir}/fence_ldom
%{_mandir}/man8/fence_ldom.8*
%package lpar
License: GPLv2+ and LGPLv2+
Summary: Fence agent for IBM LPAR
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description lpar
Fence agent for IBM LPAR devices that are accessed via telnet or SSH.
%files lpar
%{_sbindir}/fence_lpar
%{_mandir}/man8/fence_lpar.8*
%package mpath
License: GPLv2+ and LGPLv2+
Summary: Fence agent for reservations over Device Mapper Multipath
Requires: device-mapper-multipath
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description mpath
Fence agent for SCSI persistent reservation over
Device Mapper Multipath.
%files mpath
%{_sbindir}/fence_mpath
%{_mandir}/man8/fence_mpath.8*
%package netio
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Koukaam NETIO devices
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description netio
Fence agent for Koukaam NETIO devices that are accessed
via telnet or SSH.
%files netio
%{_sbindir}/fence_netio
%{_mandir}/man8/fence_netio.8*
%ifarch x86_64 ppc64le
%package openstack
License: GPLv2+ and LGPLv2+
Summary: Fence agent for OpenStack's Nova service
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
Requires: python3-requests
%else
Requires: python-requests
%endif
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description openstack
Fence agent for OpenStack's Nova service.
%files openstack
%{_sbindir}/fence_openstack
%{_mandir}/man8/fence_openstack.8*
%endif
%package ovh
License: GPLv2+ and LGPLv2+
Summary: Fence agent for OVH provider
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
Requires: python3-suds
%else
Requires: python-suds
%endif
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description ovh
Fence agent for OVH hosting provider.
%files ovh
%{_sbindir}/fence_ovh
%{_mandir}/man8/fence_ovh.8*
# skipped from allfenceagents
%package pve
License: GPLv2+ and LGPLv2+
Summary: Fence agent for PVE
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
Requires: python3-pycurl
%else
Requires: python-pycurl
%endif
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description pve
Fence agent for PVE.
%files pve
%{_sbindir}/fence_pve
%{_mandir}/man8/fence_pve.8*
# skipped from allfenceagents
%package raritan
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Raritan Dominion PX
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description raritan
Fence agent for Raritan Dominion PX.
%files raritan
%{_sbindir}/fence_raritan
%{_mandir}/man8/fence_raritan.8*
# skipped from allfenceagents
%package rcd-serial
License: GPLv2+ and LGPLv2+
Summary: Fence agent for RCD serial
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description rcd-serial
Fence agent for RCD serial.
%files rcd-serial
%{_sbindir}/fence_rcd_serial
%{_mandir}/man8/fence_rcd_serial.8*
%package redfish
License: GPLv2+ and LGPLv2+
Group: System Environment/Base
Summary: Fence agent for Redfish
Requires: fence-agents-common >= %{version}-%{release}
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
Requires: python3-requests
%else
Requires: python-requests
%endif
Obsoletes: fence-agents
%description redfish
The fence-agents-redfish package contains a fence agent for Redfish
%files redfish
%defattr(-,root,root,-)
%{_sbindir}/fence_redfish
%{_mandir}/man8/fence_redfish.8*
%package rhevm
License: GPLv2+ and LGPLv2+
Summary: Fence agent for RHEV-M
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description rhevm
Fence agent for RHEV-M via REST API.
%files rhevm
%{_sbindir}/fence_rhevm
%{_mandir}/man8/fence_rhevm.8*
%package rsa
License: GPLv2+ and LGPLv2+
Summary: Fence agent for IBM RSA II
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description rsa
Fence agent for IBM RSA II devices that are accessed
via telnet or SSH.
%files rsa
%{_sbindir}/fence_rsa
%{_mandir}/man8/fence_rsa.8*
%package rsb
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Fujitsu RSB
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description rsb
Fence agent for Fujitsu RSB devices that are accessed
via telnet or SSH.
%files rsb
%{_sbindir}/fence_rsb
%{_mandir}/man8/fence_rsb.8*
%package sanbox2
License: GPLv2+ and LGPLv2+
Summary: Fence agent for QLogic SANBox2 FC switches
Requires: telnet
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description sanbox2
Fence agent for QLogic SANBox2 switches that are accessed via telnet.
%files sanbox2
%{_sbindir}/fence_sanbox2
%{_mandir}/man8/fence_sanbox2.8*
%package sbd
License: GPLv2+ and LGPLv2+
Summary: Fence agent for SBD (storage-based death)
Requires: sbd
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description sbd
Fence agent for SBD (storage-based death).
%files sbd
%{_sbindir}/fence_sbd
%{_mandir}/man8/fence_sbd.8*
%package scsi
License: GPLv2+ and LGPLv2+
Summary: Fence agent for SCSI persistent reservations
Requires: sg3_utils
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description scsi
Fence agent for SCSI persistent reservations.
%files scsi
%{_sbindir}/fence_scsi
%{_datadir}/cluster/fence_scsi_check
%{_datadir}/cluster/fence_scsi_check_hardreboot
%{_mandir}/man8/fence_scsi.8*
%package vbox
License: GPLv2+ and LGPLv2+
Summary: Fence agent for VirtualBox
Requires: openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description vbox
Fence agent for VirtualBox dom0 accessed via SSH.
%files vbox
%{_sbindir}/fence_vbox
%{_mandir}/man8/fence_vbox.8*
# skipped from allfenceagents
%package virsh
License: GPLv2+ and LGPLv2+
Summary: Fence agent for virtual machines based on libvirt
Requires: openssh-clients /usr/bin/virsh
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description virsh
Fence agent for virtual machines that are accessed via SSH.
%files virsh
%{_sbindir}/fence_virsh
%{_mandir}/man8/fence_virsh.8*
%package vmware
License: GPLv2+ and LGPLv2+
Summary: Fence agent for VMWare with VI Perl Toolkit or vmrun
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
Requires: python3-pexpect
%else
Requires: pexpect
%endif
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description vmware
Fence agent for VMWare accessed with VI Perl Toolkit or vmrun.
%files vmware
%{_sbindir}/fence_vmware
%{_mandir}/man8/fence_vmware.8*
%package vmware-rest
License: GPLv2+ and LGPLv2+
Summary: Fence agent for VMWare with REST API
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
Obsoletes: fence-agents
%description vmware-rest
Fence agent for VMWare with REST API.
%files vmware-rest
%{_sbindir}/fence_vmware_rest
%{_mandir}/man8/fence_vmware_rest.8*
%package vmware-soap
License: GPLv2+ and LGPLv2+
Summary: Fence agent for VMWare with SOAP API v4.1+
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
Requires: python3-suds
%else
Requires: python-suds
%endif
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description vmware-soap
Fence agent for VMWare with SOAP API v4.1+.
%files vmware-soap
%{_sbindir}/fence_vmware_soap
%{_mandir}/man8/fence_vmware_soap.8*
%package vmware-vcloud
License: GPLv2+ and LGPLv2+
Summary: Fence agent for VMWare vCloud Director
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
Obsoletes: fence-agents
%description vmware-vcloud
Fence agent for VMWare vCloud Director.
%files vmware-vcloud
%{_sbindir}/fence_vmware_vcloud
%{_mandir}/man8/fence_vmware_vcloud.8*
%package wti
License: GPLv2+ and LGPLv2+
Summary: Fence agent for WTI Network power switches
Requires: telnet openssh-clients
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description wti
Fence agent for WTI network power switches that are accessed
via telnet or SSH.
%files wti
%{_sbindir}/fence_wti
%{_mandir}/man8/fence_wti.8*
%package xenapi
License: GPLv2+ and LGPLv2+
Summary: Fence agent for Citrix XenServer over XenAPI
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7 || 0%{?suse_version}
Requires: python3-pexpect
%else
Requires: pexpect
%endif
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description xenapi
Fence agent for Citrix XenServer accessed over XenAPI.
%files xenapi
%{_sbindir}/fence_xenapi
%{_datadir}/fence/XenAPI.py*
%if 0%{?fedora} || 0%{?centos} > 7 || 0%{?rhel} > 7
%{_datadir}/fence/__pycache__/XenAPI.*
%endif
%{_mandir}/man8/fence_xenapi.8*
%package zvm
License: GPLv2+ and LGPLv2+
Summary: Fence agent for IBM z/VM over IP
Requires: fence-agents-common = %{version}-%{release}
BuildArch: noarch
%description zvm
Fence agent for IBM z/VM over IP.
%files zvm
%{_sbindir}/fence_zvmip
%{_mandir}/man8/fence_zvmip.8*
%changelog
* @date@ Autotools generated version - @version@-@specver@-@numcomm@.@alphatag@.@dirty@
- Autotools generated version
diff --git a/tests/data/metadata/fence_ibmz.xml b/tests/data/metadata/fence_ibmz.xml
new file mode 100644
index 00000000..5483cba2
--- /dev/null
+++ b/tests/data/metadata/fence_ibmz.xml
@@ -0,0 +1,179 @@
+
+
+fence_ibmz is a power fencing agent which uses the HMC Web Services API to fence IBM z LPARs.
+http://www.ibm.com
+
+
+
+
+ Fencing action
+
+
+
+
+ IP address or hostname of fencing device
+
+
+
+
+ IP address or hostname of fencing device
+
+
+
+
+ TCP/UDP port to use for connection with device
+
+
+
+
+ Login name
+
+
+
+
+ Login password or passphrase
+
+
+
+
+ Script to run to retrieve password
+
+
+
+
+ Login password or passphrase
+
+
+
+
+ Script to run to retrieve password
+
+
+
+
+ Physical plug id in the format cpc-name/partition-name (case-sensitive)
+
+
+
+
+ Physical plug id in the format cpc-name/partition-name (case-sensitive)
+
+
+
+
+ Use SSL connection with verifying certificate
+
+
+
+
+ Login name
+
+
+
+
+ How many times to retry on connection errors
+
+
+
+
+ How long to wait to establish a connection
+
+
+
+
+ How long to wait for power operation to complete
+
+
+
+
+ How many times to retry on read errors
+
+
+
+
+ How long to wait for server data
+
+
+
+
+ Disable logging to stderr. Does not affect --verbose or --debug-file or logging to syslog.
+
+
+
+
+ Verbose mode. Multiple -v flags can be stacked on the command line (e.g., -vvv) to increase verbosity.
+
+
+
+
+ Level of debugging detail in output. Defaults to the number of --verbose flags specified on the command line, or to 1 if verbose=1 in a stonith device configuration (i.e., on stdin).
+
+
+
+
+ Write debug information to given file
+
+
+
+
+ Write debug information to given file
+
+
+
+
+ Display version information and exit
+
+
+
+
+ Display help and exit
+
+
+
+
+ Separator for CSV created by 'list' operation
+
+
+
+
+ Wait X seconds before fencing is started
+
+
+
+
+ Wait X seconds for cmd prompt after login
+
+
+
+
+ Test X seconds for status change after ON/OFF
+
+
+
+
+ Wait X seconds after issuing ON/OFF
+
+
+
+
+ Wait X seconds for cmd prompt after issuing command
+
+
+
+
+ Count of attempts to retry power on
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+