From af93a3112e5e5e6745478fae434239a1e68f1cdc Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 05 2021 22:16:03 +0000 Subject: import fence-agents-4.2.1-68.el8 --- diff --git a/SOURCES/bz1780825-fencing-add-stonith_status_sleep.patch b/SOURCES/bz1780825-fencing-add-stonith_status_sleep.patch new file mode 100644 index 0000000..4151486 --- /dev/null +++ b/SOURCES/bz1780825-fencing-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/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/SPECS/fence-agents.spec b/SPECS/fence-agents.spec index 22bf45c..a0fa4a0 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: 67%{?alphatag:.%{alphatag}}%{?dist} +Release: 68%{?alphatag:.%{alphatag}}%{?dist} License: GPLv2+ and LGPLv2+ Group: System Environment/Base URL: https://github.com/ClusterLabs/fence-agents @@ -124,6 +124,8 @@ Patch82: bz1914313-fence_zvmip-fix-disable-timeout.patch Patch83: bz1906978-fence_gce-default-to-onoff.patch Patch84: bz1925015-fence_ipmilan-add-fence_ipmilanplus.patch Patch85: bz1920947-fence_redfish-add-diag-action.patch +Patch86: bz1941989-fence_aws-add-filter-parameter.patch +Patch87: bz1780825-fencing-add-stonith_status_sleep.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 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 @@ -287,6 +289,8 @@ BuildRequires: python3-google-api-client %patch83 -p1 %patch84 -p1 %patch85 -p1 +%patch86 -p1 -F1 +%patch87 -p1 # prevent compilation of something that won't get used anyway sed -i.orig 's|FENCE_ZVM=1|FENCE_ZVM=0|' configure.ac @@ -1177,6 +1181,13 @@ Fence agent for IBM z/VM over IP. %endif %changelog +* Fri Apr 30 2021 Oyvind Albrigtsen - 4.2.1-68 +- fencing: add "stonith_status_sleep" parameter to set sleep between + status calls during STONITH action + Resolves: rhbz#1780825 +- fence_aws: add "filter" parameter + Resolves: rhbz#1941989 + * Wed Mar 3 2021 Oyvind Albrigtsen - 4.2.1-67 - fence_hds_cb: new fence agent Resolves: rhbz#1726874