public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* RHEL5 - [FENCE] Fix #460054 - fence_apc fails with pexpect exception
@ 2008-09-11 16:00 Marek Grác
  0 siblings, 0 replies; only message in thread
From: Marek Grác @ 2008-09-11 16:00 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=1aa2974320e02dd80e1c894bf841a68d9a10edb1
Commit:        1aa2974320e02dd80e1c894bf841a68d9a10edb1
Parent:        c4d3329edf341b9a09232fdfb029387302a241c5
Author:        Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate:    Thu Sep 11 17:46:57 2008 +0200
Committer:     Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Thu Sep 11 17:49:38 2008 +0200

[FENCE] Fix #460054 - fence_apc fails with pexpect exception

In some special unspecified cases it is possible that
connection will be closed before we run close(). This is not
a problem because everything is checked before.
---
 fence/agents/apc/fence_apc.py |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/fence/agents/apc/fence_apc.py b/fence/agents/apc/fence_apc.py
index 4ac8be9..e9d7f25 100755
--- a/fence/agents/apc/fence_apc.py
+++ b/fence/agents/apc/fence_apc.py
@@ -15,7 +15,7 @@
 ##        cipher (des/blowfish) have to be defined
 #####
 
-import sys, re, pexpect
+import sys, re, pexpect, exceptions
 sys.path.append("/usr/lib/fence")
 from fencing import *
 
@@ -192,9 +192,16 @@ def main():
 
 	##
 	## Logout from system
+	##
+	## In some special unspecified cases it is possible that 
+	## connection will be closed before we run close(). This is not 
+	## a problem because everything is checked before.
 	######
-	conn.sendline("4")
-	conn.close()
+	try:
+		conn.sendline("4")
+		conn.close()
+	except exceptions.OSError:
+		pass
 
 if __name__ == "__main__":
 	main()


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-11 15:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-11 16:00 RHEL5 - [FENCE] Fix #460054 - fence_apc fails with pexpect exception 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).