From 3e7ab15a7d1bcbbe804662ee9c5d34ccbbb4a577 Mon Sep 17 00:00:00 2001 From: snobear Date: Fri, 11 Jul 2014 11:56:17 -0400 Subject: [PATCH] better error message for vSphere connection issues --- ezmomi/ezmomi.py | 5 +++-- setup.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ezmomi/ezmomi.py b/ezmomi/ezmomi.py index cdbe439..1374744 100644 --- a/ezmomi/ezmomi.py +++ b/ezmomi/ezmomi.py @@ -86,9 +86,10 @@ def connect(self): pwd = self.config['password'], port = int(self.config['port']), ) - except: + except Exception as e: print 'Unable to connect to vsphere server.' - sys.exit() + print e.msg + sys.exit(1) # add a clean up routine atexit.register(Disconnect, self.si) diff --git a/setup.py b/setup.py index 55faa53..a8afdd5 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='ezmomi', - version='0.2.2', + version='0.2.3', author='Jason Ashby', author_email='jashby2@gmail.com', packages=['ezmomi'], @@ -23,4 +23,4 @@ "pyvmomi==5.5.0", "wsgiref==0.1.2", ], -) \ No newline at end of file +)