libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [3/4] libcloud git commit: use strerror attr as error message Closes #967
Date Wed, 11 Jan 2017 04:48:58 GMT
use strerror attr as error message
Closes #967


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/6ee86a44
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/6ee86a44
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/6ee86a44

Branch: refs/heads/trunk
Commit: 6ee86a449049c5542a95aca33ef4e2514f17a8ef
Parents: 5591889
Author: Anthony Shaw <anthonyshaw@apache.org>
Authored: Wed Jan 4 21:56:02 2017 +1100
Committer: Anthony Shaw <anthonyshaw@apache.org>
Committed: Wed Jan 11 15:47:08 2017 +1100

----------------------------------------------------------------------
 libcloud/compute/drivers/vsphere.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/6ee86a44/libcloud/compute/drivers/vsphere.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/vsphere.py b/libcloud/compute/drivers/vsphere.py
index 6c792bb..0e122fc 100644
--- a/libcloud/compute/drivers/vsphere.py
+++ b/libcloud/compute/drivers/vsphere.py
@@ -93,11 +93,12 @@ class VSphereConnection(ConnectionUserAndKey):
         except Exception:
             e = sys.exc_info()[1]
             message = e.message
+            if hasattr(e, 'strerror'):
+                message = e.strerror
             fault = getattr(e, 'fault', None)
 
             if fault == 'InvalidLoginFault':
                 raise InvalidCredsError(message)
-
             raise LibcloudError(value=message, driver=self.driver)
 
         atexit.register(self.disconnect)


Mime
View raw message