From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20727 invoked by alias); 23 Mar 2009 13:58:16 -0000 Received: (qmail 20721 invoked by alias); 23 Mar 2009 13:58:16 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_210,SPF_HELO_PASS X-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_210,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion.fedora.phx.redhat.com Subject: cluster: STABLE3 - fence_apc: #491640 - APC Fence Agent does not work with non-admin account To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: 1597bf03ac5d09c960d643c4725aa582edc93cfe X-Git-Newrev: 3b276c2b626318d7f30532f9698e8410287615fb From: =?utf-8?q?Marek_Gr=C3=A1c?= Message-Id: <20090323135802.C840412015A@lists.fedorahosted.org> Date: Mon, 23 Mar 2009 13:58:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q1/txt/msg00868.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=3b276c2b626318d7f30532f9698e8410287615fb Commit: 3b276c2b626318d7f30532f9698e8410287615fb Parent: 1597bf03ac5d09c960d643c4725aa582edc93cfe Author: Marek 'marx' Grac AuthorDate: Mon Mar 23 14:51:05 2009 +0100 Committer: Marek 'marx' Grac CommitterDate: Mon Mar 23 14:56:39 2009 +0100 fence_apc: #491640 - 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 46e992f..f40ffeb 100755 --- a/fence/agents/apc/fence_apc.py +++ b/fence/agents/apc/fence_apc.py @@ -106,7 +106,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)): @@ -129,19 +130,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") @@ -152,10 +157,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: