This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: STABLE2 - fence_apc: #491643 - APC Fence Agent does not workwith non-admin account


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0cce4d9c97c5a05aecdf856449d8b575537042d9
Commit:        0cce4d9c97c5a05aecdf856449d8b575537042d9
Parent:        80c13f2e7eca8633159f479d6ae90aa83a0b0526
Author:        Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate:    Mon Mar 23 14:51:05 2009 +0100
Committer:     Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Mon Mar 23 14:51:05 2009 +0100

fence_apc: #491643 -  APC Fence Agent does not work with non-admin account

APC Fence agent does not work with non-admin account with firmware v3.5.x
---
 fence/agents/apc/fence_apc.py |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/fence/agents/apc/fence_apc.py b/fence/agents/apc/fence_apc.py
index 5d132be..e60fe34 100644
--- a/fence/agents/apc/fence_apc.py
+++ b/fence/agents/apc/fence_apc.py
@@ -92,7 +92,8 @@ def set_power_status(conn, options):
 		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
 
 		version = 0
-		admin = 0
+		admin2 = 0
+		admin3 = 0
 		switch = 0
 
 		if (None != re.compile('.* MasterSwitch plus.*', re.IGNORECASE | re.S).match(conn.before)):
@@ -115,19 +116,23 @@ def set_power_status(conn, options):
 			version = 3
 
 		if (None == re.compile('.*Outlet Control/Configuration.*', re.IGNORECASE | re.S).match(conn.before)):
-			admin = 0
+			admin2 = 0
 		else:
-			admin = 1
+			admin2 = 1
 
 		if switch == 0:
 			if version == 2:
-				if admin == 0:
+				if admin2 == 0:
 					conn.send("2\r\n")
 				else:
 					conn.send("3\r\n")
 			else:
 				conn.send("2\r\n")
 				conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
+				if (None == re.compile('.*2- Outlet Restriction.*', re.IGNORECASE | re.S).match(conn.before)):
+					admin3 = 0
+				else:
+					admin3 = 1
 				conn.send("1\r\n")
 		else:
 			conn.send(options["-s"] + "\r\n")
@@ -138,10 +143,10 @@ def set_power_status(conn, options):
 		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
 
 		if switch == 0:
-			if admin == 1:
+			if admin2 == 1:
 				conn.send("1\r\n")
 				conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
-			if version == 3:
+			if admin3 == 1:
 				conn.send("1\r\n")
 				conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
 		else:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]