Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > d236c5da97a239a1b6991cfba2865b66 > files > 29

cman-2.0.115-68.el5_6.1.src.rpm

From 739dc40a6de3d5b2fda26b590dac4e2577fcc396 Mon Sep 17 00:00:00 2001
From: Marek 'marx' Grac <mgrac@redhat.com>
Date: Fri, 16 Oct 2009 17:31:10 +0200
Subject: [PATCH 3/5] fencing: Accept unknown options from standard input

libefence added new option 'nodename' to every query, as most of the agents
does not need such feature, we will ignore it. Unknown options from STDIN where
handled differently before.

New policy: fence agent should accept unknown args from STDIN. It can print on STDERR warning that it is ignoring that option.

Resolves: bz#532920
---
 fence/agents/bullpap/fence_bullpap.pl |    4 ----
 fence/agents/drac/fence_drac.pl       |    5 -----
 fence/agents/egenera/fence_egenera.pl |    7 -------
 fence/agents/lib/fencing.py.py        |    3 ++-
 4 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/fence/agents/bullpap/fence_bullpap.pl b/fence/agents/bullpap/fence_bullpap.pl
index bb02fb8..a53c8e1 100755
--- a/fence/agents/bullpap/fence_bullpap.pl
+++ b/fence/agents/bullpap/fence_bullpap.pl
@@ -160,10 +160,6 @@ sub get_options_stdin
 		{
 			$verbose = $val;
 		} 
-		else 
-		{
-			fail "parse error: unknown option \"$opt\"";
-		}
 	}
 }
 
diff --git a/fence/agents/drac/fence_drac.pl b/fence/agents/drac/fence_drac.pl
index 3f3bb76..f4824cb 100755
--- a/fence/agents/drac/fence_drac.pl
+++ b/fence/agents/drac/fence_drac.pl
@@ -572,11 +572,6 @@ sub get_options_stdin
 		{
 			$cmd_prompt = $val;
 		} 
-		# Excess name/vals will fail
-		else 
-		{
-			fail "parse error: unknown option \"$opt\"";
-		}
 	}
 }
 
diff --git a/fence/agents/egenera/fence_egenera.pl b/fence/agents/egenera/fence_egenera.pl
index b516ceb..928ebb2 100755
--- a/fence/agents/egenera/fence_egenera.pl
+++ b/fence/agents/egenera/fence_egenera.pl
@@ -177,13 +177,6 @@ sub get_options_stdin
 		{
 			$user = $val;
 		}
-
-		# FIXME should we do more error checking?  
-		# Excess name/vals will be eaten for now
-		else 
-		{
-			fail "parse error: unknown option \"$opt\"";
-		}
 	}
 }
 
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index cb9bfde..21d7033 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -542,7 +542,8 @@ def process_input(avail_opt):
 			##
 			######
 			if avail_opt.count(name) == 0:
-				fail_usage("Parse error: Unknown option '"+line+"'")
+				sys.stderr.write("Parse error: Ignoring unknown option '"+line+"'\n")
+				continue
 
 			if all_opt[name]["getopt"].endswith(":"):
 				opt["-"+all_opt[name]["getopt"].rstrip(":")] = value
-- 
1.6.2.5