From 2107d21461800ced8b879a956d71597179d72f15 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 09 2021 09:46:32 +0000 Subject: import fence-agents-4.2.1-75.el8 --- diff --git a/SOURCES/bz1685814-fence_gce-add-serviceaccount-file-support.patch b/SOURCES/bz1685814-fence_gce-add-serviceaccount-file-support.patch new file mode 100644 index 0000000..6f13714 --- /dev/null +++ b/SOURCES/bz1685814-fence_gce-add-serviceaccount-file-support.patch @@ -0,0 +1,73 @@ +diff --color -uNr a/agents/gce/fence_gce.py b/agents/gce/fence_gce.py +--- a/agents/gce/fence_gce.py 2021-06-11 14:28:37.751959830 +0200 ++++ b/agents/gce/fence_gce.py 2021-06-11 14:54:03.638926494 +0200 +@@ -15,9 +15,15 @@ + import urllib2 as urlrequest + sys.path.append("@FENCEAGENTSLIBDIR@") + +-import googleapiclient.discovery + from fencing import fail_usage, run_delay, all_opt, atexit_handler, check_input, process_input, show_docs, fence_action +- ++try: ++ import googleapiclient.discovery ++ try: ++ from google.oauth2.credentials import Credentials as GoogleCredentials ++ except: ++ from oauth2client.client import GoogleCredentials ++except: ++ pass + + METADATA_SERVER = 'http://metadata.google.internal/computeMetadata/v1/' + METADATA_HEADERS = {'Metadata-Flavor': 'Google'} +@@ -175,12 +181,21 @@ + "required" : "0", + "order" : 4 + } ++ all_opt["serviceaccount"] = { ++ "getopt" : ":", ++ "longopt" : "serviceaccount", ++ "help" : "--serviceaccount=[filename] Service account json file location e.g. serviceaccount=/somedir/service_account.json", ++ "shortdesc" : "Service Account to use for authentication to the google cloud APIs.", ++ "required" : "0", ++ "order" : 9 ++ } + + + def main(): + conn = None + +- device_opt = ["port", "no_password", "zone", "project", "stackdriver-logging", "method"] ++ device_opt = ["port", "no_password", "zone", "project", "stackdriver-logging", ++ "method", "serviceaccount"] + + atexit.register(atexit_handler) + +@@ -226,10 +241,24 @@ + + # Prepare cli + try: +- credentials = None +- if tuple(googleapiclient.__version__) < tuple("1.6.0"): +- import oauth2client.client +- credentials = oauth2client.client.GoogleCredentials.get_application_default() ++ serviceaccount = options.get("--serviceaccount") ++ if serviceaccount: ++ scope = ['https://www.googleapis.com/auth/cloud-platform'] ++ logging.debug("using credentials from service account") ++ try: ++ from google.oauth2.service_account import Credentials as ServiceAccountCredentials ++ credentials = ServiceAccountCredentials.from_service_account_file(filename=serviceaccount, scopes=scope) ++ except ImportError: ++ from oauth2client.service_account import ServiceAccountCredentials ++ credentials = ServiceAccountCredentials.from_json_keyfile_name(serviceaccount, scope) ++ else: ++ try: ++ from googleapiclient import _auth ++ credentials = _auth.default_credentials(); ++ except: ++ credentials = GoogleCredentials.get_application_default() ++ logging.debug("using application default credentials") ++ + conn = googleapiclient.discovery.build('compute', 'v1', credentials=credentials) + except Exception as err: + fail_usage("Failed: Create GCE compute v1 connection: {}".format(str(err))) diff --git a/SOURCES/bz1780825-fencing-1-add-stonith_status_sleep.patch b/SOURCES/bz1780825-fencing-1-add-stonith_status_sleep.patch new file mode 100644 index 0000000..4151486 --- /dev/null +++ b/SOURCES/bz1780825-fencing-1-add-stonith_status_sleep.patch @@ -0,0 +1,47 @@ +From b322891e91649d47656d63c73a0e08e9627f0b38 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Wed, 28 Apr 2021 12:20:07 +0200 +Subject: [PATCH] fencing: add stonith_status_sleep parameter for sleep between + status calls during a STONITH action + +--- + lib/fencing.py.py | 13 +++++++++++-- + 76 files changed, 386 insertions(+), 2 deletions(-) + +diff --git a/lib/fencing.py.py b/lib/fencing.py.py +index 9654f57be..bd7f529f7 100644 +--- a/lib/fencing.py.py ++++ b/lib/fencing.py.py +@@ -367,6 +367,14 @@ + "default" : "0", + "required" : "0", + "order" : 200}, ++ "stonith_status_sleep" : { ++ "getopt" : ":", ++ "longopt" : "stonith-status-sleep", ++ "type" : "second", ++ "help" : "--stonith-status-sleep=[seconds] Sleep X seconds between status calls during a STONITH action", ++ "default" : "1", ++ "required" : "0", ++ "order" : 200}, + "missing_as_off" : { + "getopt" : "", + "longopt" : "missing-as-off", +@@ -478,7 +486,8 @@ + "default" : ["help", "debug", "verbose", "verbose_level", + "version", "action", "agent", "power_timeout", + "shell_timeout", "login_timeout", "disable_timeout", +- "power_wait", "retry_on", "delay", "quiet"], ++ "power_wait", "stonith_status_sleep", "retry_on", "delay", ++ "quiet"], + "passwd" : ["passwd_script"], + "sudo" : ["sudo_path"], + "secure" : ["identity_file", "ssh_options", "ssh_path", "inet4_only", "inet6_only"], +@@ -828,7 +837,7 @@ def async_set_multi_power_fn(connection, options, set_power_fn, get_power_fn, re + + for _ in itertools.count(1): + if get_multi_power_fn(connection, options, get_power_fn) != options["--action"]: +- time.sleep(1) ++ time.sleep(int(options["--stonith-status-sleep"])) + else: + return True diff --git a/SOURCES/bz1780825-fencing-2-metadata-fix-long-parameters.patch b/SOURCES/bz1780825-fencing-2-metadata-fix-long-parameters.patch new file mode 100644 index 0000000..5aea6f9 --- /dev/null +++ b/SOURCES/bz1780825-fencing-2-metadata-fix-long-parameters.patch @@ -0,0 +1,22 @@ +From 199b5e8a63d8b3457262751b7fbe187f92b38e73 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Tue, 4 May 2021 09:33:34 +0200 +Subject: [PATCH] fencing: fix issue with hardcoded help text length for + metadata + +--- + lib/fencing.py.py | 2 +- + 77 files changed, 153 insertions(+), 153 deletions(-) + +diff --git a/lib/fencing.py.py b/lib/fencing.py.py +index bd7f529f7..b0ddde850 100644 +--- a/lib/fencing.py.py ++++ b/lib/fencing.py.py +@@ -641,7 +641,7 @@ def metadata(options, avail_opt, docs): + mixed = _encode_html_entities(mixed) + + if not "shortdesc" in opt: +- shortdesc = re.sub("\s\s+", " ", opt["help"][31:]) ++ shortdesc = re.sub(".*\s\s+", "", opt["help"][31:]) + else: + shortdesc = opt["shortdesc"] diff --git a/SOURCES/bz1920947-fence_redfish-1-add-diag-action.patch b/SOURCES/bz1920947-fence_redfish-1-add-diag-action.patch new file mode 100644 index 0000000..68d2cda --- /dev/null +++ b/SOURCES/bz1920947-fence_redfish-1-add-diag-action.patch @@ -0,0 +1,53 @@ +From 570e04d68c3595b137b104ba723aa2e6ceca5a3a Mon Sep 17 00:00:00 2001 +From: Reid Wahl +Date: Wed, 27 Jan 2021 01:45:43 -0800 +Subject: [PATCH] fence_redfish: Add diag action + +Sends NMI to fenced node. + +Ref: + - http://redfish.dmtf.org/schemas/DSP2046_2020.3.html#redfish.dmtf.org/schemas/v1/ComputerSystem.json|details|ResetType + +Resolves: RHBZ#1920947 + +Signed-off-by: Reid Wahl +--- + agents/redfish/fence_redfish.py | 6 ++++-- + tests/data/metadata/fence_redfish.xml | 1 + + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/agents/redfish/fence_redfish.py b/agents/redfish/fence_redfish.py +index 1b259576..9a7d604d 100644 +--- a/agents/redfish/fence_redfish.py ++++ b/agents/redfish/fence_redfish.py +@@ -40,7 +40,8 @@ def set_power_status(conn, options): + action = { + 'on' : "On", + 'off': "ForceOff", +- 'reboot': "ForceRestart" ++ 'reboot': "ForceRestart", ++ 'diag': "Nmi" + }[options["--action"]] + + payload = {'ResetType': action} +@@ -119,7 +120,8 @@ def define_new_opts(): + + def main(): + atexit.register(atexit_handler) +- device_opt = ["ipaddr", "login", "passwd", "redfish-uri", "systems-uri", "ssl"] ++ device_opt = ["ipaddr", "login", "passwd", "redfish-uri", "systems-uri", ++ "ssl", "diag"] + define_new_opts() + + opt = process_input(device_opt) +diff --git a/tests/data/metadata/fence_redfish.xml b/tests/data/metadata/fence_redfish.xml +index 6daf2cd9..fb112781 100644 +--- a/tests/data/metadata/fence_redfish.xml ++++ b/tests/data/metadata/fence_redfish.xml +@@ -187,5 +187,6 @@ + + + ++ + + diff --git a/SOURCES/bz1920947-fence_redfish-2-add-diag-action-logic.patch b/SOURCES/bz1920947-fence_redfish-2-add-diag-action-logic.patch new file mode 100644 index 0000000..3b328bb --- /dev/null +++ b/SOURCES/bz1920947-fence_redfish-2-add-diag-action-logic.patch @@ -0,0 +1,49 @@ +From b50523850e7fe1ba73d4ff0ede193c9860eff2bc Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Fri, 7 May 2021 10:35:00 +0200 +Subject: [PATCH] fence_redfish: add missing diag logic + +--- + agents/redfish/fence_redfish.py | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/agents/redfish/fence_redfish.py b/agents/redfish/fence_redfish.py +index 9a7d604d3..0f5af523c 100644 +--- a/agents/redfish/fence_redfish.py ++++ b/agents/redfish/fence_redfish.py +@@ -42,7 +42,7 @@ def set_power_status(conn, options): + 'off': "ForceOff", + 'reboot': "ForceRestart", + 'diag': "Nmi" +- }[options["--action"]] ++ }[options.get("original-action") or options["--action"]] + + payload = {'ResetType': action} + +@@ -56,6 +56,8 @@ def set_power_status(conn, options): + response = send_post_request(options, action_uri, payload) + if response['ret'] is False: + fail_usage("Error sending power command") ++ if options.get("original-action") == "diag": ++ return True + return + + def send_get_request(options, uri): +@@ -159,7 +161,16 @@ def main(): + else: + options["--systems-uri"] = sysresult["uri"] + +- result = fence_action(None, options, set_power_status, get_power_status, None) ++ reboot_fn = None ++ if options["--action"] == "diag": ++ # Diag is a special action that can't be verified so we will reuse reboot functionality ++ # to minimize impact on generic library ++ options["original-action"] = options["--action"] ++ options["--action"] = "reboot" ++ options["--method"] = "cycle" ++ reboot_fn = set_power_status ++ ++ result = fence_action(None, options, set_power_status, get_power_status, None, reboot_fn) + sys.exit(result) + + if __name__ == "__main__": diff --git a/SOURCES/bz1920947-fence_redfish-3-fix-typo.patch b/SOURCES/bz1920947-fence_redfish-3-fix-typo.patch new file mode 100644 index 0000000..24f49f3 --- /dev/null +++ b/SOURCES/bz1920947-fence_redfish-3-fix-typo.patch @@ -0,0 +1,22 @@ +From 753e126d0b642159b3e936de76a814f753f0d918 Mon Sep 17 00:00:00 2001 +From: Jeffrey Cutter +Date: Mon, 16 Nov 2020 14:29:30 -0500 +Subject: [PATCH] fence_redfish: Fix typo in help. + +--- + agents/redfish/fence_redfish.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/agents/redfish/fence_redfish.py b/agents/redfish/fence_redfish.py +index c7c6492c6..1b259576e 100644 +--- a/agents/redfish/fence_redfish.py ++++ b/agents/redfish/fence_redfish.py +@@ -102,7 +102,7 @@ def define_new_opts(): + all_opt["redfish-uri"] = { + "getopt" : ":", + "longopt" : "redfish-uri", +- "help" : "--redfish-uri=[uri] Base or starting Redifsh URI", ++ "help" : "--redfish-uri=[uri] Base or starting Redfish URI", + "required" : "0", + "default" : "/redfish/v1", + "shortdesc" : "Base or starting Redfish URI", diff --git a/SOURCES/bz1922437-fence_mpath-watchdog-retry-support.patch b/SOURCES/bz1922437-fence_mpath-watchdog-retry-support.patch new file mode 100644 index 0000000..41d0c3d --- /dev/null +++ b/SOURCES/bz1922437-fence_mpath-watchdog-retry-support.patch @@ -0,0 +1,111 @@ +From 2c9ce6a7667e09010d498ca9d9bcf6e476123bbb Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Thu, 20 May 2021 12:51:12 +0200 +Subject: [PATCH] fence_mpath: watchdog retries support + +Added options to be able to be able to set number of retries and sleep between retries. +--- + agents/mpath/fence_mpath.py | 44 +++++++++++++++++++++-------- + tests/data/metadata/fence_mpath.xml | 4 ++- + 2 files changed, 35 insertions(+), 13 deletions(-) + +diff --git a/agents/mpath/fence_mpath.py b/agents/mpath/fence_mpath.py +index 08dab6536..61ab1f205 100644 +--- a/agents/mpath/fence_mpath.py ++++ b/agents/mpath/fence_mpath.py +@@ -4,6 +4,7 @@ + import stat + import re + import os ++import time + import logging + import atexit + import ctypes +@@ -167,14 +168,20 @@ def dev_read(options, fail=True): + store_fh.close() + return dev_key + +-def mpath_check_get_verbose(): ++def mpath_check_get_options(options): + try: +- f = open("/etc/sysconfig/watchdog", "r") ++ f = open("/etc/sysconfig/stonith", "r") + except IOError: +- return False +- match = re.search(r"^\s*verbose=yes", "".join(f.readlines()), re.MULTILINE) ++ return options ++ ++ match = re.findall(r"^\s*(\S*)\s*=\s*(\S*)\s*", "".join(f.readlines()), re.MULTILINE) ++ ++ for m in match: ++ options[m[0].lower()] = m[1].lower() ++ + f.close() +- return bool(match) ++ ++ return options + + def mpath_check(hardreboot=False): + if len(sys.argv) >= 3 and sys.argv[1] == "repair": +@@ -183,18 +190,27 @@ def mpath_check(hardreboot=False): + options["--mpathpersist-path"] = "/usr/sbin/mpathpersist" + options["--store-path"] = "/var/run/cluster" + options["--power-timeout"] = "5" +- if mpath_check_get_verbose(): ++ options["retry"] = "0" ++ options["retry-sleep"] = "1" ++ options = mpath_check_get_options(options) ++ if "verbose" in options and options["verbose"] == "yes": + logging.getLogger().setLevel(logging.DEBUG) + devs = dev_read(options, fail=False) + if not devs: + logging.error("No devices found") + return 0 + for dev, key in list(devs.items()): +- if key in get_registration_keys(options, dev, fail=False): +- logging.debug("key " + key + " registered with device " + dev) +- return 0 +- else: +- logging.debug("key " + key + " not registered with device " + dev) ++ for n in range(int(options["retry"]) + 1): ++ if n > 0: ++ logging.debug("retry: " + str(n) + " of " + options["retry"]) ++ if key in get_registration_keys(options, dev, fail=False): ++ logging.debug("key " + key + " registered with device " + dev) ++ return 0 ++ else: ++ logging.debug("key " + key + " not registered with device " + dev) ++ ++ if n < int(options["retry"]): ++ time.sleep(float(options["retry-sleep"])) + logging.debug("key " + key + " registered with any devices") + + if hardreboot == True: +@@ -289,7 +305,11 @@ def main(): + device(s). The result is that only registered nodes may write to the \ + device(s). When a node failure occurs, the fence_mpath agent will remove the \ + key belonging to the failed node from the device(s). The failed node will no \ +-longer be able to write to the device(s). A manual reboot is required." ++longer be able to write to the device(s). A manual reboot is required.\ ++\n.P\n\ ++When used as a watchdog device you can define e.g. retry=1, retry-sleep=2 and \ ++verbose=yes parameters in /etc/sysconfig/stonith if you have issues with it \ ++failing." + docs["vendorurl"] = "https://www.sourceware.org/dm/" + show_docs(options, docs) + +diff --git a/tests/data/metadata/fence_mpath.xml b/tests/data/metadata/fence_mpath.xml +index 524776aa0..0255d4b4e 100644 +--- a/tests/data/metadata/fence_mpath.xml ++++ b/tests/data/metadata/fence_mpath.xml +@@ -1,7 +1,9 @@ + + + fence_mpath is an I/O fencing agent that uses SCSI-3 persistent reservations to control access multipath devices. Underlying devices must support SCSI-3 persistent reservations (SPC-3 or greater) as well as the "preempt-and-abort" subcommand. +-The fence_mpath agent works by having a unique key for each node that has to be set in /etc/multipath.conf. Once registered, a single node will become the reservation holder by creating a "write exclusive, registrants only" reservation on the device(s). The result is that only registered nodes may write to the device(s). When a node failure occurs, the fence_mpath agent will remove the key belonging to the failed node from the device(s). The failed node will no longer be able to write to the device(s). A manual reboot is required. ++The fence_mpath agent works by having a unique key for each node that has to be set in /etc/multipath.conf. Once registered, a single node will become the reservation holder by creating a "write exclusive, registrants only" reservation on the device(s). The result is that only registered nodes may write to the device(s). When a node failure occurs, the fence_mpath agent will remove the key belonging to the failed node from the device(s). The failed node will no longer be able to write to the device(s). A manual reboot is required. ++ ++When used as a watchdog device you can define e.g. retry=1, retry-sleep=2 and verbose=yes parameters in /etc/sysconfig/stonith if you have issues with it failing. + https://www.sourceware.org/dm/ + + diff --git a/SOURCES/bz1925015-fence_ipmilan-add-fence_ipmilanplus.patch b/SOURCES/bz1925015-fence_ipmilan-add-fence_ipmilanplus.patch new file mode 100644 index 0000000..c642704 --- /dev/null +++ b/SOURCES/bz1925015-fence_ipmilan-add-fence_ipmilanplus.patch @@ -0,0 +1,38 @@ +From 08a4521f9361c7ca4877e691fa82cc0e8f51d707 Mon Sep 17 00:00:00 2001 +From: Thomas Renninger +Date: Wed, 3 Feb 2021 11:20:14 +0100 +Subject: [PATCH] Add fence_ipmilanplus as fence_ipmilan wrapper always + enabling lanplus + +Lanplus (IPMI protocol version 2) is the up-to-date protocol to +connect to all recent IPMI driven BMCs. +Using fence_ipmilan without lanplus=1 will fail on these. + +To get around compatibility issues (old HW might still exist), +a new fence_agent is introduced via link and basename check. +--- + agents/ipmilan/fence_ipmilan.py | 3 + + 9 files changed, 240 insertions(+) + create mode 100644 tests/data/metadata/fence_ipmilanplus.xml + +diff --git a/agents/ipmilan/fence_ipmilan.py b/agents/ipmilan/fence_ipmilan.py +index ee014e79..f751de69 100644 +--- a/agents/ipmilan/fence_ipmilan.py ++++ b/agents/ipmilan/fence_ipmilan.py +@@ -187,6 +187,8 @@ def main(): + all_opt["lanplus"]["default"] = "1" + elif os.path.basename(sys.argv[0]) == "fence_ilo5": + all_opt["lanplus"]["default"] = "1" ++ elif os.path.basename(sys.argv[0]) == "fence_ipmilanplus": ++ all_opt["lanplus"]["default"] = "1" + + all_opt["ipport"]["default"] = "623" + all_opt["method"]["help"] = "-m, --method=[method] Method to fence (onoff|cycle) (Default: onoff)\n" \ +@@ -206,6 +208,7 @@ def main(): + docs["symlink"] = [("fence_ilo3", "Fence agent for HP iLO3"), + ("fence_ilo4", "Fence agent for HP iLO4"), + ("fence_ilo5", "Fence agent for HP iLO5"), ++ ("fence_ipmilanplus", "Fence agent for IPMIv2 lanplus"), + ("fence_imm", "Fence agent for IBM Integrated Management Module"), + ("fence_idrac", "Fence agent for Dell iDRAC")] + show_docs(options, docs) diff --git a/SOURCES/bz1941989-fence_aws-add-filter-parameter.patch b/SOURCES/bz1941989-fence_aws-add-filter-parameter.patch new file mode 100644 index 0000000..18d457b --- /dev/null +++ b/SOURCES/bz1941989-fence_aws-add-filter-parameter.patch @@ -0,0 +1,91 @@ +From d920421ccb3abb42ecb9ea3ba56948db00fe1c80 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Tue, 23 Mar 2021 12:14:11 +0100 +Subject: [PATCH] fence_aws: add filter parameter to be able to limit which + nodes are listed + +--- + agents/aws/fence_aws.py | 27 +++++++++++++++++++++------ + tests/data/metadata/fence_aws.xml | 5 +++++ + 2 files changed, 26 insertions(+), 6 deletions(-) + +diff --git a/agents/aws/fence_aws.py b/agents/aws/fence_aws.py +index 8322df9ed..c947bf29c 100644 +--- a/agents/aws/fence_aws.py ++++ b/agents/aws/fence_aws.py +@@ -38,8 +38,15 @@ def get_nodes_list(conn, options): + logger.info("Starting monitor operation") + result = {} + try: +- for instance in conn.instances.all(): +- result[instance.id] = ("", None) ++ if "--filter" in options: ++ filter_key = options["--filter"].split("=")[0].strip() ++ filter_value = options["--filter"].split("=")[1].strip() ++ filter = [{ "Name": filter_key, "Values": [filter_value] }] ++ for instance in conn.instances.filter(Filters=filter): ++ result[instance.id] = ("", None) ++ else: ++ for instance in conn.instances.all(): ++ result[instance.id] = ("", None) + except ClientError: + fail_usage("Failed: Incorrect Access Key or Secret Key.") + except EndpointConnectionError: +@@ -111,7 +118,7 @@ def define_new_opts(): + all_opt["region"] = { + "getopt" : "r:", + "longopt" : "region", +- "help" : "-r, --region=[region] Region, e.g. us-east-1", ++ "help" : "-r, --region=[region] Region, e.g. us-east-1", + "shortdesc" : "Region.", + "required" : "0", + "order" : 2 +@@ -132,21 +139,29 @@ def define_new_opts(): + "required" : "0", + "order" : 4 + } ++ all_opt["filter"] = { ++ "getopt" : ":", ++ "longopt" : "filter", ++ "help" : "--filter=[key=value] Filter (e.g. vpc-id=[vpc-XXYYZZAA]", ++ "shortdesc": "Filter for list-action", ++ "required": "0", ++ "order": 5 ++ } + all_opt["boto3_debug"] = { + "getopt" : "b:", + "longopt" : "boto3_debug", +- "help" : "-b, --boto3_debug=[option] Boto3 and Botocore library debug logging", ++ "help" : "-b, --boto3_debug=[option] Boto3 and Botocore library debug logging", + "shortdesc": "Boto Lib debug", + "required": "0", + "default": "False", +- "order": 5 ++ "order": 6 + } + + # Main agent method + def main(): + conn = None + +- device_opt = ["port", "no_password", "region", "access_key", "secret_key", "boto3_debug"] ++ device_opt = ["port", "no_password", "region", "access_key", "secret_key", "filter", "boto3_debug"] + + atexit.register(atexit_handler) + +diff --git a/tests/data/metadata/fence_aws.xml b/tests/data/metadata/fence_aws.xml +index 1f3ab3b97..a767e93c2 100644 +--- a/tests/data/metadata/fence_aws.xml ++++ b/tests/data/metadata/fence_aws.xml +@@ -36,6 +36,11 @@ For instructions see: https://boto3.readthedocs.io/en/latest/guide/quickstart.ht + + Secret Key. + ++ ++ ++ ++ Filter for list-action ++ + + + diff --git a/SOURCES/bz1942363-fence_gce-default-to-cycle.patch b/SOURCES/bz1942363-fence_gce-default-to-cycle.patch new file mode 100644 index 0000000..3034deb --- /dev/null +++ b/SOURCES/bz1942363-fence_gce-default-to-cycle.patch @@ -0,0 +1,37 @@ +From b8793b7cdacf0eb13e86581fcba1f78bb7a4bc13 Mon Sep 17 00:00:00 2001 +From: Tim Megela +Date: Thu, 11 Mar 2021 06:41:59 -0500 +Subject: [PATCH] Default method moved back to powercycle + +Moving back to powercycle as the default method for GCE. This is the recommended approach from Google. Using on/off as the default will have unintended consequences on google cloud platforms. +--- + agents/gce/fence_gce.py | 2 ++ + tests/data/metadata/fence_gce.xml | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/agents/gce/fence_gce.py b/agents/gce/fence_gce.py +index 1784e1b70..d59ce2bad 100644 +--- a/agents/gce/fence_gce.py ++++ b/agents/gce/fence_gce.py +@@ -358,6 +358,8 @@ def main(): + define_new_opts() + + all_opt["power_timeout"]["default"] = "60" ++ all_opt["method"]["default"] = "cycle" ++ all_opt["method"]["help"] = "-m, --method=[method] Method to fence (onoff|cycle) (Default: cycle)" + + options = check_input(device_opt, process_input(device_opt)) + +diff --git a/tests/data/metadata/fence_gce.xml b/tests/data/metadata/fence_gce.xml +index f09c771f3..bb5137878 100644 +--- a/tests/data/metadata/fence_gce.xml ++++ b/tests/data/metadata/fence_gce.xml +@@ -12,7 +12,7 @@ For instructions see: https://cloud.google.com/compute/docs/tutorials/python-gui + + + +- ++ + diff --git a/SOURCES/bz1977819-fence_aws-add-filter-parameter.patch b/SOURCES/bz1977819-fence_aws-add-filter-parameter.patch deleted file mode 100644 index 18d457b..0000000 --- a/SOURCES/bz1977819-fence_aws-add-filter-parameter.patch +++ /dev/null @@ -1,91 +0,0 @@ -From d920421ccb3abb42ecb9ea3ba56948db00fe1c80 Mon Sep 17 00:00:00 2001 -From: Oyvind Albrigtsen -Date: Tue, 23 Mar 2021 12:14:11 +0100 -Subject: [PATCH] fence_aws: add filter parameter to be able to limit which - nodes are listed - ---- - agents/aws/fence_aws.py | 27 +++++++++++++++++++++------ - tests/data/metadata/fence_aws.xml | 5 +++++ - 2 files changed, 26 insertions(+), 6 deletions(-) - -diff --git a/agents/aws/fence_aws.py b/agents/aws/fence_aws.py -index 8322df9ed..c947bf29c 100644 ---- a/agents/aws/fence_aws.py -+++ b/agents/aws/fence_aws.py -@@ -38,8 +38,15 @@ def get_nodes_list(conn, options): - logger.info("Starting monitor operation") - result = {} - try: -- for instance in conn.instances.all(): -- result[instance.id] = ("", None) -+ if "--filter" in options: -+ filter_key = options["--filter"].split("=")[0].strip() -+ filter_value = options["--filter"].split("=")[1].strip() -+ filter = [{ "Name": filter_key, "Values": [filter_value] }] -+ for instance in conn.instances.filter(Filters=filter): -+ result[instance.id] = ("", None) -+ else: -+ for instance in conn.instances.all(): -+ result[instance.id] = ("", None) - except ClientError: - fail_usage("Failed: Incorrect Access Key or Secret Key.") - except EndpointConnectionError: -@@ -111,7 +118,7 @@ def define_new_opts(): - all_opt["region"] = { - "getopt" : "r:", - "longopt" : "region", -- "help" : "-r, --region=[region] Region, e.g. us-east-1", -+ "help" : "-r, --region=[region] Region, e.g. us-east-1", - "shortdesc" : "Region.", - "required" : "0", - "order" : 2 -@@ -132,21 +139,29 @@ def define_new_opts(): - "required" : "0", - "order" : 4 - } -+ all_opt["filter"] = { -+ "getopt" : ":", -+ "longopt" : "filter", -+ "help" : "--filter=[key=value] Filter (e.g. vpc-id=[vpc-XXYYZZAA]", -+ "shortdesc": "Filter for list-action", -+ "required": "0", -+ "order": 5 -+ } - all_opt["boto3_debug"] = { - "getopt" : "b:", - "longopt" : "boto3_debug", -- "help" : "-b, --boto3_debug=[option] Boto3 and Botocore library debug logging", -+ "help" : "-b, --boto3_debug=[option] Boto3 and Botocore library debug logging", - "shortdesc": "Boto Lib debug", - "required": "0", - "default": "False", -- "order": 5 -+ "order": 6 - } - - # Main agent method - def main(): - conn = None - -- device_opt = ["port", "no_password", "region", "access_key", "secret_key", "boto3_debug"] -+ device_opt = ["port", "no_password", "region", "access_key", "secret_key", "filter", "boto3_debug"] - - atexit.register(atexit_handler) - -diff --git a/tests/data/metadata/fence_aws.xml b/tests/data/metadata/fence_aws.xml -index 1f3ab3b97..a767e93c2 100644 ---- a/tests/data/metadata/fence_aws.xml -+++ b/tests/data/metadata/fence_aws.xml -@@ -36,6 +36,11 @@ For instructions see: https://boto3.readthedocs.io/en/latest/guide/quickstart.ht - - Secret Key. - -+ -+ -+ -+ Filter for list-action -+ - - - diff --git a/SPECS/fence-agents.spec b/SPECS/fence-agents.spec index aaf5475..5315bc1 100644 --- a/SPECS/fence-agents.spec +++ b/SPECS/fence-agents.spec @@ -29,7 +29,7 @@ Name: fence-agents Summary: Set of unified programs capable of host isolation ("fencing") Version: 4.2.1 -Release: 65%{?alphatag:.%{alphatag}}%{?dist}.1 +Release: 75%{?alphatag:.%{alphatag}}%{?dist} License: GPLv2+ and LGPLv2+ Group: System Environment/Base URL: https://github.com/ClusterLabs/fence-agents @@ -122,10 +122,19 @@ Patch80: bz1841087-fence_scsi-dont-write-key-device-to-file.patch Patch81: bz1896827-fence_aws-add-imdsv2-support.patch Patch82: bz1914313-fence_zvmip-fix-disable-timeout.patch Patch83: bz1906978-fence_gce-default-to-onoff.patch -Patch84: bz1977819-fence_aws-add-filter-parameter.patch +Patch84: bz1925015-fence_ipmilan-add-fence_ipmilanplus.patch +Patch85: bz1920947-fence_redfish-1-add-diag-action.patch +Patch86: bz1941989-fence_aws-add-filter-parameter.patch +Patch87: bz1780825-fencing-1-add-stonith_status_sleep.patch +Patch88: bz1780825-fencing-2-metadata-fix-long-parameters.patch +Patch89: bz1942363-fence_gce-default-to-cycle.patch +Patch90: bz1920947-fence_redfish-2-add-diag-action-logic.patch +Patch91: bz1920947-fence_redfish-3-fix-typo.patch +Patch92: bz1922437-fence_mpath-watchdog-retry-support.patch +Patch93: bz1685814-fence_gce-add-serviceaccount-file-support.patch %if 0%{?fedora} || 0%{?rhel} > 7 -%global supportedagents amt_ws apc apc_snmp bladecenter brocade cisco_mds cisco_ucs compute drac5 eaton_snmp emerson eps evacuate hpblade ibmblade ifmib ilo ilo_moonshot ilo_mp ilo_ssh intelmodular ipdu ipmilan kdump lpar mpath redfish rhevm rsa rsb sbd scsi vmware_rest vmware_soap wti +%global supportedagents amt_ws apc apc_snmp bladecenter brocade cisco_mds cisco_ucs compute drac5 eaton_snmp emerson eps evacuate hds_cb hpblade ibmblade ifmib ilo ilo_moonshot ilo_mp ilo_ssh intelmodular ipdu ipmilan kdump lpar mpath redfish rhevm rsa rsb sbd scsi vmware_rest vmware_soap wti %ifarch x86_64 %global testagents virsh heuristics_ping aliyun aws azure_arm gce %endif @@ -284,7 +293,16 @@ BuildRequires: python3-google-api-client %patch81 -p1 %patch82 -p1 %patch83 -p1 -%patch84 -p1 -F1 +%patch84 -p1 +%patch85 -p1 +%patch86 -p1 -F1 +%patch87 -p1 +%patch88 -p1 +%patch89 -p1 +%patch90 -p1 +%patch91 -p1 +%patch92 -p1 +%patch93 -p1 # prevent compilation of something that won't get used anyway sed -i.orig 's|FENCE_ZVM=1|FENCE_ZVM=0|' configure.ac @@ -708,6 +726,7 @@ Group: System Environment/Base Summary: Fence agent for GCE (Google Cloud Engine) Requires: fence-agents-common >= %{version}-%{release} Requires: python3-google-api-client +Requires: python3-pysocks Obsoletes: %{name} < %{version}-%{release} BuildArch: noarch %description gce @@ -915,6 +934,8 @@ Fence agents for devices with IPMI interface. %{_mandir}/man8/fence_ilo4.8* %{_sbindir}/fence_ilo5 %{_mandir}/man8/fence_ilo5.8* +%{_sbindir}/fence_ipmilanplus +%{_mandir}/man8/fence_ipmilanplus.8* %{_sbindir}/fence_imm %{_mandir}/man8/fence_imm.8* @@ -1154,9 +1175,34 @@ Fence agent for IBM z/VM over IP. %endif %changelog -* Thu Jul 1 2021 Oyvind Albrigtsen - 4.2.1-65.1 +* Wed Aug 11 2021 Oyvind Albrigtsen - 4.2.1-75 +- fence_gce: add serviceaccount JSON file support + Resolves: rhbz#1685814 + +* Thu May 20 2021 Oyvind Albrigtsen - 4.2.1-72 +- fence_mpath: add watchdog retry support + Resolves: rhbz#1922437 + +* Fri May 7 2021 Oyvind Albrigtsen - 4.2.1-71 +- fence_redfish: add diag action + Resolves: rhbz#1920947 + +* Thu May 6 2021 Oyvind Albrigtsen - 4.2.1-70 +- fence_gce: change default back to cycle to avoid "soft" off + Resolves: rhbz#1942363 + +* Tue May 4 2021 Oyvind Albrigtsen - 4.2.1-69 +- fencing: add "stonith_status_sleep" parameter to set sleep between + status calls during STONITH action + Resolves: rhbz#1780825 + +* Fri Apr 30 2021 Oyvind Albrigtsen - 4.2.1-68 - fence_aws: add "filter" parameter - Resolves: rhbz#1977819 + Resolves: rhbz#1941989 + +* Wed Mar 3 2021 Oyvind Albrigtsen - 4.2.1-67 +- fence_ipmilanplus: new symlink agent with lanplus enabled by default + Resolves: rhbz#1925015 * Tue Feb 2 2021 Oyvind Albrigtsen - 4.2.1-65 - fence_gce: default to onoff