Blame SOURCES/bz1257137-1-fence_ipmilan_regression.patch

44709c
From 31d6f75837251dae4a494fe361105c8f6fa63a17 Mon Sep 17 00:00:00 2001
44709c
From: Marek 'marx' Grac <mgrac@redhat.com>
44709c
Date: Wed, 2 Sep 2015 14:35:23 +0200
44709c
Subject: [PATCH 1/3] fence_ipmilan: Restore deprecated option -i which is
44709c
 alias to -a / --ip
44709c
44709c
Resolves: rhbz#1257137
44709c
---
44709c
 fence/agents/ipmilan/fence_ipmilan.py | 16 +++++++++++++---
44709c
 1 file changed, 13 insertions(+), 3 deletions(-)
44709c
44709c
diff --git a/fence/agents/ipmilan/fence_ipmilan.py b/fence/agents/ipmilan/fence_ipmilan.py
44709c
index 8490837..8224b83 100644
44709c
--- a/fence/agents/ipmilan/fence_ipmilan.py
44709c
+++ b/fence/agents/ipmilan/fence_ipmilan.py
44709c
@@ -119,12 +119,18 @@ def define_new_opts():
44709c
 		"default" : "@IPMITOOL_PATH@",
44709c
 		"order": 200
44709c
 	}
44709c
+	all_opt["obsolete_ip"] = {
44709c
+		"getopt" : "i:",
44709c
+		"longopt" : "obsolete-ip",
44709c
+		"help" : "",
44709c
+		"order" : 1
44709c
+	}
44709c
 
44709c
 def main():
44709c
 	atexit.register(atexit_handler)
44709c
 
44709c
-	device_opt = ["ipaddr", "login", "no_login", "no_password", "passwd",
44709c
-		"lanplus", "auth", "cipher", "privlvl", "sudo", "ipmitool_path", "method"]
44709c
+	device_opt = ["ipaddr", "ipport", "login", "no_login", "no_password", "passwd",
44709c
+		"lanplus", "auth", "cipher", "privlvl", "sudo", "ipmitool_path", "method", "obsolete_ip"]
44709c
 	define_new_opts()
44709c
 
44709c
 	if os.path.basename(sys.argv[0]) == "fence_ilo3":
44709c
@@ -136,7 +142,11 @@ def main():
44709c
 
44709c
 	all_opt["ipport"]["default"] = "623"
44709c
 
44709c
-	options = check_input(device_opt, process_input(device_opt))
44709c
+	pi = process_input(device_opt)
44709c
+	# Accept also deprecated option but do not propagate it at all
44709c
+	if "--obsolete-ip" in pi:
44709c
+		pi["--ip"] = pi["--obsolete-ip"]
44709c
+	options = check_input(device_opt, pi)
44709c
 
44709c
 	docs = {}
44709c
 	docs["shortdesc"] = "Fence agent for IPMI"
44709c
-- 
44709c
1.9.3
44709c