Pārlūkot izejas kodu

More Python 2.4 fixes

Ask Solem 14 gadi atpakaļ
vecāks
revīzija
0d97b585a0

+ 7 - 7
celery/task/http.py

@@ -46,13 +46,13 @@ def extract_response(raw_response):
     except ValueError, exc:
         raise InvalidResponseError(str(exc))
 
-        status = payload["status"]
-        if status == "success":
-            return payload["retval"]
-        elif status == "failure":
-            raise RemoteExecuteError(payload.get("reason"))
-        else:
-            raise UnknownStatusError(str(status))
+    status = payload["status"]
+    if status == "success":
+        return payload["retval"]
+    elif status == "failure":
+        raise RemoteExecuteError(payload.get("reason"))
+    else:
+        raise UnknownStatusError(str(status))
 
 
 class MutableURL(object):

+ 2 - 0
celery/worker/control/__init__.py

@@ -59,6 +59,8 @@ class ControlDispatch(object):
         else:
             try:
                 reply = control(self.panel, **kwdict(kwargs))
+	    except SystemExit:
+		raise
             except Exception, exc:
                 self.logger.error(
                         "Error running control command %s kwargs=%s: %s" % (

+ 1 - 1
celery/worker/control/builtins.py

@@ -178,4 +178,4 @@ def ping(panel, **kwargs):
 @Panel.register
 def shutdown(panel, **kwargs):
     panel.logger.critical("Got shutdown from remote.")
-    raise SystemExit
+    raise SystemExit("Got shutdown from remote")