Blame SOURCES/bz1377389-fence_ipmilan-add-target-support.patch

217e50
diff -uNr a/fence/agents/ipmilan/fence_ipmilan.py b/fence/agents/ipmilan/fence_ipmilan.py
217e50
--- a/fence/agents/ipmilan/fence_ipmilan.py	2017-05-04 14:32:36.357497106 +0200
217e50
+++ b/fence/agents/ipmilan/fence_ipmilan.py	2017-05-04 14:37:32.567801127 +0200
217e50
@@ -39,9 +39,18 @@
217e50
 		cmd += " -I lanplus"
217e50
 	else:
217e50
 		cmd += " -I lan"
217e50
+
217e50
 	# --ip / -a
217e50
 	cmd += " -H " + options["--ip"]
217e50
 
217e50
+	# --port / -n
217e50
+	if options.has_key("--ipport"):
217e50
+		cmd += " -p " + options["--ipport"]
217e50
+
217e50
+	# --target
217e50
+	if "--target" in options:
217e50
+		cmd += " -t " + options["--target"]
217e50
+
217e50
 	# --username / -l
217e50
 	if options.has_key("--username") and len(options["--username"]) != 0:
217e50
 		cmd += " -U " + quote(options["--username"])
217e50
@@ -60,10 +69,6 @@
217e50
 	if "--cipher" in options:
217e50
 		cmd += " -C " + options["--cipher"]
217e50
 
217e50
-	# --port / -n
217e50
-	if options.has_key("--ipport"):
217e50
-		cmd += " -p " + options["--ipport"]
217e50
-
217e50
 	if options.has_key("--privlvl"):
217e50
 		cmd += " -L " + options["--privlvl"]
217e50
 
217e50
@@ -123,6 +128,14 @@
217e50
 		"default" : "@IPMITOOL_PATH@",
217e50
 		"order": 200
217e50
 	}
217e50
+	all_opt["target"] = {
217e50
+		"getopt" : ":",
217e50
+		"longopt" : "target",
217e50
+		"help" : "--target=[targetaddress]       Bridge IPMI requests to the remote target address",
217e50
+		"required" : "0",
217e50
+		"shortdesc" : "Bridge IPMI requests to the remote target address",
217e50
+		"order": 1
217e50
+	}
217e50
 	all_opt["obsolete_ip"] = {
217e50
 		"getopt" : "i:",
217e50
 		"longopt" : "obsolete-ip",
217e50
@@ -141,9 +154,9 @@
217e50
 def main():
217e50
 	atexit.register(atexit_handler)
217e50
 
217e50
-	device_opt = ["ipaddr", "login", "no_login", "no_password", "passwd", "diag", 
217e50
-		"lanplus", "auth", "cipher", "privlvl", "sudo", "ipmitool_path", "method",
217e50
-		"obsolete_ip", "timeout"]
217e50
+	device_opt = ["ipaddr", "login", "no_login", "no_password", "passwd",
217e50
+		"diag", "lanplus", "auth", "cipher", "privlvl", "sudo",
217e50
+		"ipmitool_path", "method", "target", "obsolete_ip", "timeout"]
217e50
 	define_new_opts()
217e50
 
217e50
 	all_opt["power_wait"]["default"] = 2
217e50
diff -uNr a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
217e50
--- a/fence/agents/lib/fencing.py.py	2017-05-04 14:32:36.408496642 +0200
217e50
+++ b/fence/agents/lib/fencing.py.py	2017-05-04 14:33:30.160007419 +0200
217e50
@@ -845,7 +845,7 @@
217e50
 			device_opt.count("login") and (device_opt.count("no_login") == 0):
217e50
 		fail_usage("Failed: You have to set login name")
217e50
 
217e50
-	if device_opt.count("ipaddr") and not options.has_key("--ip") and not options.has_key("--managed"):
217e50
+	if device_opt.count("ipaddr") and not options.has_key("--ip") and not options.has_key("--managed") and not options.has_key("--target"):
217e50
 		fail_usage("Failed: You have to enter fence address")
217e50
 
217e50
 	if device_opt.count("no_password") == 0:
217e50
diff -uNr a/tests/data/metadata/fence_idrac.xml b/tests/data/metadata/fence_idrac.xml
217e50
--- a/tests/data/metadata/fence_idrac.xml	2017-05-04 14:32:36.410496624 +0200
217e50
+++ b/tests/data/metadata/fence_idrac.xml	2017-05-04 14:33:30.160007419 +0200
217e50
@@ -74,6 +74,11 @@
217e50
 		<content type="string"  />
217e50
 		<shortdesc lang="en">Ciphersuite to use (same as ipmitool -C parameter)</shortdesc>
217e50
 	</parameter>
217e50
+	<parameter name="target" unique="0" required="0">
217e50
+		<getopt mixed="--target=[targetaddress]" />
217e50
+		<content type="string"  />
217e50
+		<shortdesc lang="en">Bridge IPMI requests to the remote target address</shortdesc>
217e50
+	</parameter>
217e50
 	<parameter name="privlvl" unique="0" required="0">
217e50
 		<getopt mixed="-L, --privlvl=[level]" />
217e50
 		<content type="select" default="administrator"  >
217e50
diff -uNr a/tests/data/metadata/fence_ilo3.xml b/tests/data/metadata/fence_ilo3.xml
217e50
--- a/tests/data/metadata/fence_ilo3.xml	2017-05-04 14:32:36.411496614 +0200
217e50
+++ b/tests/data/metadata/fence_ilo3.xml	2017-05-04 14:33:30.161007410 +0200
217e50
@@ -74,6 +74,11 @@
217e50
 		<content type="string"  />
217e50
 		<shortdesc lang="en">Ciphersuite to use (same as ipmitool -C parameter)</shortdesc>
217e50
 	</parameter>
217e50
+	<parameter name="target" unique="0" required="0">
217e50
+		<getopt mixed="--target=[targetaddress]" />
217e50
+		<content type="string"  />
217e50
+		<shortdesc lang="en">Bridge IPMI requests to the remote target address</shortdesc>
217e50
+	</parameter>
217e50
 	<parameter name="privlvl" unique="0" required="0">
217e50
 		<getopt mixed="-L, --privlvl=[level]" />
217e50
 		<content type="select" default="administrator"  >
217e50
diff -uNr a/tests/data/metadata/fence_ilo4.xml b/tests/data/metadata/fence_ilo4.xml
217e50
--- a/tests/data/metadata/fence_ilo4.xml	2017-05-04 14:32:36.411496614 +0200
217e50
+++ b/tests/data/metadata/fence_ilo4.xml	2017-05-04 14:33:30.161007410 +0200
217e50
@@ -74,6 +74,11 @@
217e50
 		<content type="string"  />
217e50
 		<shortdesc lang="en">Ciphersuite to use (same as ipmitool -C parameter)</shortdesc>
217e50
 	</parameter>
217e50
+	<parameter name="target" unique="0" required="0">
217e50
+		<getopt mixed="--target=[targetaddress]" />
217e50
+		<content type="string"  />
217e50
+		<shortdesc lang="en">Bridge IPMI requests to the remote target address</shortdesc>
217e50
+	</parameter>
217e50
 	<parameter name="privlvl" unique="0" required="0">
217e50
 		<getopt mixed="-L, --privlvl=[level]" />
217e50
 		<content type="select" default="administrator"  >
217e50
diff -uNr a/tests/data/metadata/fence_imm.xml b/tests/data/metadata/fence_imm.xml
217e50
--- a/tests/data/metadata/fence_imm.xml	2017-05-04 14:32:36.412496605 +0200
217e50
+++ b/tests/data/metadata/fence_imm.xml	2017-05-04 14:33:30.162007401 +0200
217e50
@@ -74,6 +74,11 @@
217e50
 		<content type="string"  />
217e50
 		<shortdesc lang="en">Ciphersuite to use (same as ipmitool -C parameter)</shortdesc>
217e50
 	</parameter>
217e50
+	<parameter name="target" unique="0" required="0">
217e50
+		<getopt mixed="--target=[targetaddress]" />
217e50
+		<content type="string"  />
217e50
+		<shortdesc lang="en">Bridge IPMI requests to the remote target address</shortdesc>
217e50
+	</parameter>
217e50
 	<parameter name="privlvl" unique="0" required="0">
217e50
 		<getopt mixed="-L, --privlvl=[level]" />
217e50
 		<content type="select" default="administrator"  >
217e50
diff -uNr a/tests/data/metadata/fence_ipmilan.xml b/tests/data/metadata/fence_ipmilan.xml
217e50
--- a/tests/data/metadata/fence_ipmilan.xml	2017-05-04 14:32:36.412496605 +0200
217e50
+++ b/tests/data/metadata/fence_ipmilan.xml	2017-05-04 14:33:30.162007401 +0200
217e50
@@ -74,6 +74,11 @@
217e50
 		<content type="string"  />
217e50
 		<shortdesc lang="en">Ciphersuite to use (same as ipmitool -C parameter)</shortdesc>
217e50
 	</parameter>
217e50
+	<parameter name="target" unique="0" required="0">
217e50
+		<getopt mixed="--target=[targetaddress]" />
217e50
+		<content type="string"  />
217e50
+		<shortdesc lang="en">Bridge IPMI requests to the remote target address</shortdesc>
217e50
+	</parameter>
217e50
 	<parameter name="privlvl" unique="0" required="0">
217e50
 		<getopt mixed="-L, --privlvl=[level]" />
217e50
 		<content type="select" default="administrator"  >