public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: "Marek Grác" <marx@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: RHEL5 - fence_agents: #501586 - fence agents fails with pexpect exception
Date: Mon, 08 Jun 2009 12:05:00 -0000	[thread overview]
Message-ID: <20090608120531.92B83120197@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ed2e22dd942b8bb2fcea3a453cc97fda4b5d9020
Commit:        ed2e22dd942b8bb2fcea3a453cc97fda4b5d9020
Parent:        1dd2ea4c92fe04059bce0363dc17d38f0df8500d
Author:        Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate:    Mon Jun 8 13:51:21 2009 +0200
Committer:     Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Mon Jun 8 14:01:28 2009 +0200

fence_agents: #501586 - fence agents fails with pexpect exception

try / except added to every fence agent where we try to exit using 'logout' functions.
This happends after fencing was succesfull so it should not be a problem if it fails.
---
 fence/agents/bladecenter/fence_bladecenter.py |    9 +++++++--
 fence/agents/drac/fence_drac5.py              |    9 +++++++--
 fence/agents/lpar/fence_lpar.py               |    9 +++++++--
 fence/agents/rsa/fence_rsa.py                 |    9 +++++++--
 fence/agents/virsh/fence_virsh.py             |    9 +++++++--
 fence/agents/wti/fence_wti.py                 |    9 +++++++--
 6 files changed, 42 insertions(+), 12 deletions(-)

diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py
index 9fdfe97..3e7204a 100755
--- a/fence/agents/bladecenter/fence_bladecenter.py
+++ b/fence/agents/bladecenter/fence_bladecenter.py
@@ -86,8 +86,13 @@ def main():
 	##
 	## Logout from system
 	######
-	conn.send("exit\r\n")
-	conn.close()
+	try:
+		conn.send("exit\r\n")
+		conn.close()
+	except exceptions.OSError:
+		pass
+	except pexpect.ExceptionPexpect:
+		pass
 
 if __name__ == "__main__":
 	main()
diff --git a/fence/agents/drac/fence_drac5.py b/fence/agents/drac/fence_drac5.py
index cf760b0..556ccb3 100755
--- a/fence/agents/drac/fence_drac5.py
+++ b/fence/agents/drac/fence_drac5.py
@@ -92,8 +92,13 @@ def main():
 	##
 	## Logout from system
 	######
-	conn.sendline("exit")
-	conn.close()
+	try:
+		conn.sendline("exit")
+		conn.close()
+	except exceptions.OSError:
+		pass
+	except pexpect.ExceptionPexpect:
+		pass
 
 if __name__ == "__main__":
 	main()
diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py
index 2b669e3..91c3d6a 100755
--- a/fence/agents/lpar/fence_lpar.py
+++ b/fence/agents/lpar/fence_lpar.py
@@ -122,8 +122,13 @@ def main():
 	##
 	## Logout from system
 	######
-	conn.send("quit\r\n")
-	conn.close()
+	try:
+		conn.send("quit\r\n")
+		conn.close()
+	except exceptions.OSError:
+		pass
+	except pexpect.ExceptionPexpect:
+		pass	                                         
 
 if __name__ == "__main__":
 	main()
diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py
index 17b0fb9..e7f131c 100755
--- a/fence/agents/rsa/fence_rsa.py
+++ b/fence/agents/rsa/fence_rsa.py
@@ -65,8 +65,13 @@ def main():
 	##
 	## Logout from system
 	######
-	conn.sendline("exit")
-	conn.close()
+	try:
+		conn.sendline("exit")
+		conn.close()
+	except exceptions.OSError:
+		pass
+	except pexpect.ExceptionPexpect:
+		pass	
 
 if __name__ == "__main__":
 	main()
diff --git a/fence/agents/virsh/fence_virsh.py b/fence/agents/virsh/fence_virsh.py
index 11c3576..15885c6 100644
--- a/fence/agents/virsh/fence_virsh.py
+++ b/fence/agents/virsh/fence_virsh.py
@@ -80,8 +80,13 @@ def main():
 	fence_action(conn, options, set_power_status, get_power_status)
 
 	## Logout from system
-	conn.sendline("quit")
-	conn.close()
+	try:
+		conn.sendline("quit")
+		conn.close()
+	except exceptions.OSError:
+		pass
+	except pexpect.ExceptionPexpect:
+		pass
 
 if __name__ == "__main__":
 	main()
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index 0016a90..5740cd4 100755
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -110,8 +110,13 @@ def main():
 	##
 	## Logout from system
 	######
-	conn.send("/X"+"\r\n")
-	conn.close()
+	try:
+		conn.send("/X"+"\r\n")
+		conn.close()
+	except exceptions.OSError:
+		pass
+	except pexpect.ExceptionPexpect:
+		pass
 
 if __name__ == "__main__":
 	main()


                 reply	other threads:[~2009-06-08 12:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090608120531.92B83120197@lists.fedorahosted.org \
    --to=marx@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).