[pkg-eucalyptus-commits] [SCM] managing cloud instances for Eucalyptus branch, master, updated. 3.0.0-alpha3-257-g1da8e3a
Garrett Holmstrom
gholms at fedoraproject.org
Sun Jun 16 02:30:41 UTC 2013
The following commit has been merged in the master branch:
commit c2fdab86a0220bd5f196a28c0bd3fc3842a45ccf
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date: Sun Mar 17 01:55:26 2013 -0700
Add more fallback info sources to AWSError
diff --git a/euca2ools/exceptions.py b/euca2ools/exceptions.py
index 001174a..4341c4b 100644
--- a/euca2ools/exceptions.py
+++ b/euca2ools/exceptions.py
@@ -154,8 +154,8 @@ class AWSError(requestbuilder.exceptions.ServerError):
parsed = parsed['Errors']
if 'Error' in parsed:
parsed = parsed['Error']
- self.code = parsed.get('Code')
- self.message = parsed.get('Message')
+ self.code = parsed.get('Code') or response.status_code
+ self.message = parsed.get('Message') or response.reason
self.elements = parsed
except ValueError:
# Dump the unparseable message body so we don't include
@@ -164,6 +164,10 @@ class AWSError(requestbuilder.exceptions.ServerError):
# in case we need it later.
self.message = self.body
self.body = None
+ self.code = response.status_code
+ else:
+ self.code = response.status_code
+ self.message = response.reason
def __str__(self):
s_bits = [self.__class__.__name__ + ':', self.code or self.status_code]
--
managing cloud instances for Eucalyptus
More information about the pkg-eucalyptus-commits
mailing list