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 <anthonys...@apache.org> Authored: Wed Jan 4 21:56:02 2017 +1100 Committer: Anthony Shaw <anthonys...@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)