public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - fence_agents: #501586 - fence agents fails with pexpect exception
@ 2009-06-08 11:58 Marek Grác
0 siblings, 0 replies; only message in thread
From: Marek Grác @ 2009-06-08 11:58 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6b02842572472e1cac2f77d7bda6ea6a0c3d4047
Commit: 6b02842572472e1cac2f77d7bda6ea6a0c3d4047
Parent: 9e136f15ea1e6f46bc46317f3f2f9c5504b462b9
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 13:51:21 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/alom/fence_alom.py | 9 +++++++--
fence/agents/bladecenter/fence_bladecenter.py | 9 +++++++--
fence/agents/drac/fence_drac5.py | 9 +++++++--
fence/agents/ldom/fence_ldom.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 +++++++--
8 files changed, 56 insertions(+), 16 deletions(-)
diff --git a/fence/agents/alom/fence_alom.py b/fence/agents/alom/fence_alom.py
index e1632cc..0ad5082 100644
--- a/fence/agents/alom/fence_alom.py
+++ b/fence/agents/alom/fence_alom.py
@@ -64,8 +64,13 @@ def main():
fence_action(conn, options, set_power_status, get_power_status,None)
# Logout from system
- conn.sendline("logout")
- conn.close()
+ try:
+ conn.sendline("logout")
+ conn.close()
+ except exceptions.OSError:
+ pass
+ except pexpect.ExceptionPexpect:
+ pass
if __name__ == "__main__":
main()
diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py
index f8882a0..ae0f37a 100644
--- a/fence/agents/bladecenter/fence_bladecenter.py
+++ b/fence/agents/bladecenter/fence_bladecenter.py
@@ -112,8 +112,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 bffd4f2..ef105d5 100755
--- a/fence/agents/drac/fence_drac5.py
+++ b/fence/agents/drac/fence_drac5.py
@@ -117,8 +117,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/ldom/fence_ldom.py b/fence/agents/ldom/fence_ldom.py
index 683e54f..4839faa 100644
--- a/fence/agents/ldom/fence_ldom.py
+++ b/fence/agents/ldom/fence_ldom.py
@@ -107,8 +107,13 @@ def main():
##
## Logout from system
######
- conn.sendline("logout")
- conn.close()
+ try:
+ conn.sendline("logout")
+ 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 04737ce..0ac96c1 100644
--- a/fence/agents/lpar/fence_lpar.py
+++ b/fence/agents/lpar/fence_lpar.py
@@ -166,8 +166,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 100644
--- 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 3eeb4be..bbb88ec 100644
--- a/fence/agents/virsh/fence_virsh.py
+++ b/fence/agents/virsh/fence_virsh.py
@@ -82,8 +82,13 @@ def main():
fence_action(conn, options, set_power_status, get_power_status, get_outlets_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 7ef5868..98b1d49 100644
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -119,8 +119,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()
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-06-08 11:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-08 11:58 cluster: STABLE3 - fence_agents: #501586 - fence agents 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).