This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: RHEL5 - fencing: #501586 - fence agents fails with pexpectexception


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4d1e5e8187632e150588d5515635b6468f726f83
Commit:        4d1e5e8187632e150588d5515635b6468f726f83
Parent:        f106b915e18e2323f549fbbf0e956c0ee884fb2e
Author:        Marek Grac <mgrac@redhat.com>
AuthorDate:    Thu Jul 23 11:32:41 2009 +0200
Committer:     Marek Grac <mgrac@redhat.com>
CommitterDate: Thu Jul 23 11:32:41 2009 +0200

fencing: #501586 - fence agents fails with pexpect exception

Added import exceptions. Fence agent for VMWare was not checked for these
exceptions.
---
 fence/agents/bladecenter/fence_bladecenter.py |    2 +-
 fence/agents/drac/fence_drac5.py              |    2 +-
 fence/agents/lpar/fence_lpar.py               |    2 +-
 fence/agents/rsa/fence_rsa.py                 |    2 +-
 fence/agents/virsh/fence_virsh.py             |    2 +-
 fence/agents/vmware/fence_vmware.py           |   11 ++++++++---
 fence/agents/wti/fence_wti.py                 |    2 +-
 7 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py
index 5272df3..92b5d06 100755
--- a/fence/agents/bladecenter/fence_bladecenter.py
+++ b/fence/agents/bladecenter/fence_bladecenter.py
@@ -13,7 +13,7 @@
 ##
 #####
 
-import sys, re, pexpect
+import sys, re, pexpect, exceptions
 sys.path.append("/usr/lib/fence")
 from fencing import *
 
diff --git a/fence/agents/drac/fence_drac5.py b/fence/agents/drac/fence_drac5.py
index 3b951c0..e50f59a 100755
--- a/fence/agents/drac/fence_drac5.py
+++ b/fence/agents/drac/fence_drac5.py
@@ -12,7 +12,7 @@
 ## @note: drac_version was removed
 #####
 
-import sys, re, pexpect
+import sys, re, pexpect, exceptions
 sys.path.append("/usr/lib/fence")
 from fencing import *
 
diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py
index 353ca06..0f76c22 100755
--- a/fence/agents/lpar/fence_lpar.py
+++ b/fence/agents/lpar/fence_lpar.py
@@ -11,7 +11,7 @@
 ##
 #####
 
-import sys, re, pexpect
+import sys, re, pexpect, exceptions
 sys.path.append("/usr/lib/fence")
 from fencing import *
 
diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py
index dd2f579..399e3c0 100755
--- a/fence/agents/rsa/fence_rsa.py
+++ b/fence/agents/rsa/fence_rsa.py
@@ -7,7 +7,7 @@
 ##
 #####
 
-import sys, re, pexpect
+import sys, re, pexpect, exceptions
 sys.path.append("@FENCEAGENTSLIBDIR@")
 from fencing import *
 
diff --git a/fence/agents/virsh/fence_virsh.py b/fence/agents/virsh/fence_virsh.py
index ae8cd23..2f8a250 100644
--- a/fence/agents/virsh/fence_virsh.py
+++ b/fence/agents/virsh/fence_virsh.py
@@ -6,7 +6,7 @@
 ##
 #####
 
-import sys, re, pexpect
+import sys, re, pexpect, exceptions
 sys.path.append("/usr/lib/fence")
 from fencing import *
 
diff --git a/fence/agents/vmware/fence_vmware.py b/fence/agents/vmware/fence_vmware.py
index 3cbb900..1aa0a1e 100755
--- a/fence/agents/vmware/fence_vmware.py
+++ b/fence/agents/vmware/fence_vmware.py
@@ -7,7 +7,7 @@
 ## 
 #####
 
-import sys, re, pexpect
+import sys, re, pexpect, exceptions
 sys.path.append("/usr/lib/fence")
 from fencing import *
 
@@ -104,8 +104,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/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index 4d9f6b2..132c8af 100755
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -12,7 +12,7 @@
 ##  WTI IPS-800-CE     v1.40h		(no username)
 #####
 
-import sys, re, pexpect
+import sys, re, pexpect, exceptions
 sys.path.append("/usr/lib/fence")
 from fencing import *
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]