From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9304 invoked by alias); 8 Jun 2009 12:05:57 -0000 Received: (qmail 9298 invoked by alias); 8 Jun 2009 12:05:56 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: RHEL5 - fence_agents: #501586 - fence agents fails with pexpect exception To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/RHEL5 X-Git-Reftype: branch X-Git-Oldrev: 1dd2ea4c92fe04059bce0363dc17d38f0df8500d X-Git-Newrev: ed2e22dd942b8bb2fcea3a453cc97fda4b5d9020 From: =?utf-8?q?Marek_Gr=C3=A1c?= Message-Id: <20090608120531.92B83120197@lists.fedorahosted.org> Date: Mon, 08 Jun 2009 12:05:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00480.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ed2e22dd942b8bb2fcea3a453cc97fda4b5d9020 Commit: ed2e22dd942b8bb2fcea3a453cc97fda4b5d9020 Parent: 1dd2ea4c92fe04059bce0363dc17d38f0df8500d Author: Marek 'marx' Grac AuthorDate: Mon Jun 8 13:51:21 2009 +0200 Committer: Marek 'marx' Grac 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()