]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
transport: Handle 503 in the same way as 502.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Jun 2013 16:03:58 +0000 (18:03 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Jun 2013 16:03:58 +0000 (18:03 +0200)
python/pakfire/transport.py

index f301652d59ff35c19ffbbbb2e0373cc5eb323257..982f5401630c8f8a714b19b684e859a0bb914068 100644 (file)
@@ -260,7 +260,7 @@ class PakfireHubTransport(object):
                                        raise TransportNotFoundError, url
                                elif e.code == 500:
                                        raise TransportInternalServerError, url
-                               elif e.code == 503:
+                               elif e.code in (502, 503):
                                        raise TransportBadGatewayError, url
                                elif e.code == 504:
                                        raise TransportConnectionTimeoutError, url
@@ -278,8 +278,8 @@ class PakfireHubTransport(object):
                        try:
                                return self.one_request(url, **kwargs)
 
-                       # 500 - Internal Server Error
-                       except TransportInternalServerError, e:
+                       # 500 - Internal Server Error, 502 + 503 Bad Gateway Error
+                       except (TransportInternalServerError, TransportBadGateway), e:
                                log.exception("%s" % e.__class__.__name__)
 
                                # Wait a minute before trying again.