- fence_ibm_vpc: add proxy support

Resolves: rhbz#2092385
This commit is contained in:
Oyvind Albrigtsen 2022-06-01 15:40:24 +02:00
parent 1a21744d97
commit 1e2e29ff71
2 changed files with 69 additions and 1 deletions

View File

@ -0,0 +1,62 @@
From be409554bbc99df2bba22cb01e8a6df634af896d Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Tue, 31 May 2022 15:46:40 +0200
Subject: [PATCH] fence_ibm_vpc: add proxy support
---
agents/ibm_vpc/fence_ibm_vpc.py | 11 +++++++++++
tests/data/metadata/fence_ibm_vpc.xml | 5 +++++
2 files changed, 16 insertions(+)
diff --git a/agents/ibm_vpc/fence_ibm_vpc.py b/agents/ibm_vpc/fence_ibm_vpc.py
index 9e38e8301..3da3ce056 100755
--- a/agents/ibm_vpc/fence_ibm_vpc.py
+++ b/agents/ibm_vpc/fence_ibm_vpc.py
@@ -88,6 +88,7 @@ def connect(opt):
conn.setopt(pycurl.TIMEOUT, int(opt["--shell-timeout"]))
conn.setopt(pycurl.SSL_VERIFYPEER, 1)
conn.setopt(pycurl.SSL_VERIFYHOST, 2)
+ conn.setopt(pycurl.PROXY, "{}".format(opt["--proxy"]))
# get bearer token
bearer_token = get_bearer_token(conn, opt)
@@ -169,6 +170,15 @@ def define_new_opts():
"shortdesc" : "Region",
"order" : 0
}
+ all_opt["proxy"] = {
+ "getopt" : ":",
+ "longopt" : "proxy",
+ "help" : "--proxy=[http://<URL>:<PORT>] Proxy: 'http://<URL>:<PORT>'",
+ "required" : "0",
+ "default": "",
+ "shortdesc" : "Network proxy",
+ "order" : 0
+ }
all_opt["limit"] = {
"getopt" : ":",
"longopt" : "limit",
@@ -185,6 +195,7 @@ def main():
"apikey",
"region",
"limit",
+ "proxy",
"port",
"no_password",
]
diff --git a/tests/data/metadata/fence_ibm_vpc.xml b/tests/data/metadata/fence_ibm_vpc.xml
index ee7151673..09da0e303 100644
--- a/tests/data/metadata/fence_ibm_vpc.xml
+++ b/tests/data/metadata/fence_ibm_vpc.xml
@@ -13,6 +13,11 @@
<content type="string" default="50" />
<shortdesc lang="en">Number of nodes returned by API</shortdesc>
</parameter>
+ <parameter name="proxy" unique="0" required="0">
+ <getopt mixed="--proxy=[http://&lt;URL&gt;:&lt;PORT&gt;]" />
+ <content type="string" default="" />
+ <shortdesc lang="en">Network proxy</shortdesc>
+ </parameter>
<parameter name="region" unique="0" required="1">
<getopt mixed="--region=[region]" />
<content type="string" />

View File

@ -59,7 +59,7 @@
Name: fence-agents
Summary: Set of unified programs capable of host isolation ("fencing")
Version: 4.10.0
Release: 25%{?alphatag:.%{alphatag}}%{?dist}
Release: 26%{?alphatag:.%{alphatag}}%{?dist}
License: GPLv2+ and LGPLv2+
URL: https://github.com/ClusterLabs/fence-agents
Source0: https://fedorahosted.org/releases/f/e/fence-agents/%{name}-%{version}.tar.gz
@ -239,6 +239,7 @@ Patch22: bz2079889-fence_gce-update.patch
Patch23: bz2081235-fence_ibm_vpc-fix-parameters.patch
Patch24: bz2086559-fence_apc-fence_ilo_moonshot-import-logging.patch
Patch25: bz2072420-2-fence_zvmip-connect-error.patch
Patch26: bz2092385-fence_ibm_vpc-add-proxy-support.patch
%global supportedagents amt_ws apc apc_snmp bladecenter brocade cisco_mds cisco_ucs compute drac5 eaton_snmp emerson eps evacuate hpblade ibmblade ibm_powervs ibm_vpc ifmib ilo ilo_moonshot ilo_mp ilo_ssh intelmodular ipdu ipmilan kdump kubevirt lpar mpath redfish rhevm rsa rsb sbd scsi vmware_rest vmware_soap wti
%ifarch x86_64
@ -375,6 +376,7 @@ BuildRequires: %{systemd_units}
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
# prevent compilation of something that won't get used anyway
sed -i.orig 's|FENCE_ZVM=1|FENCE_ZVM=0|' configure.ac
@ -1466,6 +1468,10 @@ are located on corosync cluster nodes.
%endif
%changelog
* Wed Jun 1 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.10.0-26
- fence_ibm_vpc: add proxy support
Resolves: rhbz#2092385
* Tue May 31 2022 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.10.0-25
- all agents: unify ssl parameters to avoid having to use --ssl when
using --ssl-secure/--ssl-insecure for some agents