public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* RHEL5 - [fence] WTI should not power on/off plug if it is unable to get status
@ 2008-10-29 16:32 Marek Grác
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Grác @ 2008-10-29 16:32 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=fc2051344ab193479a396b75b9a055ace443c31b
Commit:        fc2051344ab193479a396b75b9a055ace443c31b
Parent:        71c6153b1cdcca74b4c4f21b623deba233c2f1c6
Author:        Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate:    Wed Oct 29 16:50:31 2008 +0100
Committer:     Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Wed Oct 29 16:50:31 2008 +0100

[fence] WTI should not power on/off plug if it is unable to get status

Fix #468904 - I have to remember difference between and/or
---
 fence/agents/lib/fencing.py.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index e71ab29..808564a 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -359,7 +359,7 @@ def wait_power_status(tn, options, get_power_fn):
 def fence_action(tn, options, set_power_fn, get_power_fn):
 	status = get_power_fn(tn, options)
 
-	if status != "on" or status != "off":  
+	if status != "on" and status != "off":  
 		fail(EC_STATUS)
 
 	if options["-o"] == "on":


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RHEL5 - [fence] WTI should not power on/off plug if it is unable to get status
@ 2008-10-29 15:46 Marek Grác
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Grác @ 2008-10-29 15:46 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=71c6153b1cdcca74b4c4f21b623deba233c2f1c6
Commit:        71c6153b1cdcca74b4c4f21b623deba233c2f1c6
Parent:        ae8bd1b0fe749b8c4af6de77b423c9be3c3653e9
Author:        Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate:    Wed Oct 29 16:20:39 2008 +0100
Committer:     Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Wed Oct 29 16:29:18 2008 +0100

[fence] WTI should not power on/off plug if it is unable to get status

Fix #468904. On some WTI devices plugs are numbered as 1,2,3 and on the others as
A1,A2,...B1,.... Both types accept numbers (A1 = 1, B1 = [number of last A] + 1).
Power on/off works with numbers but if we want to parse status of plug then
we have a problem. This patch is a general solution (fencing library) because
it tests value of get_status() which have to be on/off otherwise we exit with
new error code.
---
 fence/agents/lib/fencing.py.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 9e7aa97..e71ab29 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -28,6 +28,7 @@ EC_CONNECTION_LOST = 4
 EC_TIMED_OUT       = 5
 EC_WAITING_ON      = 6
 EC_WAITING_OFF     = 7
+EC_STATUS          = 8
 
 TELNET_PATH = "/usr/bin/telnet"
 SSH_PATH    = "/usr/bin/ssh"
@@ -177,7 +178,8 @@ def fail(error_code):
 		EC_CONNECTION_LOST : "Connection lost",
 		EC_TIMED_OUT : "Connection timed out",
 		EC_WAITING_ON : "Failed: Timed out waiting to power ON",
-		EC_WAITING_OFF : "Failed: Timed out waiting to power OFF"
+		EC_WAITING_OFF : "Failed: Timed out waiting to power OFF",
+		EC_STATUS : "Failed: Unable to obtain correct plug status"
 	}[error_code] + "\n"
 	sys.stderr.write(message)
 	sys.exit(error_code)
@@ -357,6 +359,9 @@ def wait_power_status(tn, options, get_power_fn):
 def fence_action(tn, options, set_power_fn, get_power_fn):
 	status = get_power_fn(tn, options)
 
+	if status != "on" or status != "off":  
+		fail(EC_STATUS)
+
 	if options["-o"] == "on":
 		if status == "on":
 			print "Success: Already ON"


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-29 16:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-29 16:32 RHEL5 - [fence] WTI should not power on/off plug if it is unable to get status Marek Grác
  -- strict thread matches above, loose matches on Subject: below --
2008-10-29 15:46 Marek Grác

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).