Blame SOURCES/bz2091826-fence_ibm_vpc-add-proxy-support.patch

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