public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* fence-agents: master - fence_agents: #501586 - fence agents fails with pexpect exception
@ 2009-06-08 12:51 Marek Grác
0 siblings, 0 replies; only message in thread
From: Marek Grác @ 2009-06-08 12:51 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=8295703337b41907738c5b3f7aae7d741ce69a4e
Commit: 8295703337b41907738c5b3f7aae7d741ce69a4e
Parent: 40d44a7dee64cfce418336b1257639d2c1a93a5e
Author: Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate: Mon Jun 8 14:47:38 2009 +0200
Committer: Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Mon Jun 8 14:47:38 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 c9c9fe7..faba923 100644
--- a/fence/agents/lpar/fence_lpar.py
+++ b/fence/agents/lpar/fence_lpar.py
@@ -165,8 +165,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 8683e38..d6b3d38 100644
--- a/fence/agents/rsa/fence_rsa.py
+++ b/fence/agents/rsa/fence_rsa.py
@@ -64,8 +64,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 12:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-08 12:51 fence-agents: master - 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).