summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/api/swarm.py4
-rw-r--r--docker/errors.py4
-rw-r--r--docker/models/swarm.py3
3 files changed, 9 insertions, 2 deletions
diff --git a/docker/api/swarm.py b/docker/api/swarm.py
index 6a1b752..edc206f 100644
--- a/docker/api/swarm.py
+++ b/docker/api/swarm.py
@@ -197,6 +197,10 @@ class SwarmApiMixin(object):
# Ignore "this node is not part of a swarm" error
if force and response.status_code == http_client.NOT_ACCEPTABLE:
return True
+ # FIXME: Temporary workaround for 1.13.0-rc bug
+ # https://github.com/docker/docker/issues/29192
+ if force and response.status_code == http_client.SERVICE_UNAVAILABLE:
+ return True
self._raise_for_status(response)
return True
diff --git a/docker/errors.py b/docker/errors.py
index 8572007..05f4cae 100644
--- a/docker/errors.py
+++ b/docker/errors.py
@@ -21,7 +21,9 @@ def create_api_error_from_http_exception(e):
explanation = response.content.strip()
cls = APIError
if response.status_code == 404:
- if explanation and 'No such image' in str(explanation):
+ if explanation and ('No such image' in str(explanation) or
+ 'not found: does not exist or no read access'
+ in str(explanation)):
cls = ImageNotFound
else:
cls = NotFound
diff --git a/docker/models/swarm.py b/docker/models/swarm.py
index 38c1e9f..adfc51d 100644
--- a/docker/models/swarm.py
+++ b/docker/models/swarm.py
@@ -15,7 +15,8 @@ class Swarm(Model):
try:
self.reload()
except APIError as e:
- if e.response.status_code != 406:
+ # FIXME: https://github.com/docker/docker/issues/29192
+ if e.response.status_code not in (406, 503):
raise
@property