Repository: libcloud
Updated Branches:
refs/heads/trunk 7ec025e2d -> 1e359b36d
Add class ServiceUnavailableError for HTTP 503 return codes
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/e597775b
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/e597775b
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/e597775b
Branch: refs/heads/trunk
Commit: e597775b93fdc8159eab3ec1b20a6ec4e45396c3
Parents: ee7a2c2
Author: Francisco Ros <fjros@doalitic.com>
Authored: Wed May 24 09:00:53 2017 +0200
Committer: Anthony Shaw <anthonyshaw@apache.org>
Committed: Sun Jun 18 12:24:08 2017 +1000
----------------------------------------------------------------------
libcloud/common/types.py | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/e597775b/libcloud/common/types.py
----------------------------------------------------------------------
diff --git a/libcloud/common/types.py b/libcloud/common/types.py
index b5ff512..9572728 100644
--- a/libcloud/common/types.py
+++ b/libcloud/common/types.py
@@ -100,6 +100,17 @@ class InvalidCredsError(ProviderError):
InvalidCredsException = InvalidCredsError
+class ServiceUnavailableError(ProviderError):
+ """Exception used when a provider returns 503 Service Unavailable."""
+
+ def __init__(self, value='Service unavailable at provider', driver=None):
+ super(ServiceUnavailableError, self).__init__(
+ value,
+ http_code=httplib.SERVICE_UNAVAILABLE,
+ driver=driver
+ )
+
+
class LazyList(object):
def __init__(self, get_more, value_dict=None):
|