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

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=929b0ada6043dd3bc0b7029183010436b1a9343c
Commit:        929b0ada6043dd3bc0b7029183010436b1a9343c
Parent:        b510f49442c733617c88051057f538abff17b412
Author:        Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate:    Thu Sep 11 17:57:45 2008 +0200
Committer:     Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Thu Sep 11 17:57:45 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 65b9502..b8f0637 100644
--- a/fence/agents/apc/fence_apc.py
+++ b/fence/agents/apc/fence_apc.py
@@ -14,7 +14,7 @@
 ##        cipher (des/blowfish) have to be defined
 #####
 
-import sys, re, pexpect
+import sys, re, pexpect, exceptions
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
 
@@ -191,9 +191,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 16:00 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:05 STABLE2 - [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).