Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=715b34f9c... Commit: 715b34f9c3770b46f49dfd20e3aaef9dfd461596 Parent: aef3292971598b39f237be8400f41d55e080219a Author: Marek 'marx' Grac mgrac@redhat.com AuthorDate: Wed Feb 6 14:00:28 2013 +0100 Committer: Marek 'marx' Grac mgrac@redhat.com CommitterDate: Wed Feb 6 14:04:35 2013 +0100
fence_vmware_soap: Fix traceback when hostname cannot be resolved to IP address
Resolves: rhbz#902404 --- fence/agents/vmware_soap/fence_vmware_soap.py | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/fence/agents/vmware_soap/fence_vmware_soap.py b/fence/agents/vmware_soap/fence_vmware_soap.py index 0da7f0d..f01d37b 100644 --- a/fence/agents/vmware_soap/fence_vmware_soap.py +++ b/fence/agents/vmware_soap/fence_vmware_soap.py @@ -21,16 +21,17 @@ def soap_login(options): url = "http://" url += options["-a"] + ":" + str(options["-u"]) + "/sdk" - conn = Client(url + "/vimService.wsdl") - conn.set_options(location = url) - - mo_ServiceInstance = Property('ServiceInstance') - mo_ServiceInstance._type = 'ServiceInstance' - ServiceContent = conn.service.RetrieveServiceContent(mo_ServiceInstance) - mo_SessionManager = Property(ServiceContent.sessionManager.value) - mo_SessionManager._type = 'SessionManager' - + try: + conn = Client(url + "/vimService.wsdl") + conn.set_options(location = url) + + mo_ServiceInstance = Property('ServiceInstance') + mo_ServiceInstance._type = 'ServiceInstance' + ServiceContent = conn.service.RetrieveServiceContent(mo_ServiceInstance) + mo_SessionManager = Property(ServiceContent.sessionManager.value) + mo_SessionManager._type = 'SessionManager' + SessionManager = conn.service.Login(mo_SessionManager, options["-l"], options["-p"]) except Exception, ex: fail(EC_LOGIN_DENIED)