Browse Source

Fixed daemon context creation, was probably broken a few commits ago.

michael 15 years ago
parent
commit
77cf338e6e
1 changed files with 3 additions and 8 deletions
  1. 3 8
      celery/platform.py

+ 3 - 8
celery/platform.py

@@ -63,7 +63,7 @@ def create_daemon_context(logfile=None, pidfile=None, **options):
     if logfile:
         open(logfile, "a").close()
 
-    options["pidlock"] = pidfile and acquire_pidlock(pidfile)
+    options["pidfile"] = pidfile and acquire_pidlock(pidfile)
 
     defaults = {"uid": lambda: os.geteuid(),
                 "gid": lambda: os.getegid(),
@@ -72,15 +72,10 @@ def create_daemon_context(logfile=None, pidfile=None, **options):
                 "working_directory": lambda: os.getcwd()}
 
     for opt_name, opt_default_gen in defaults.items():
-        if opt_name not in options:
+        if opt_name not in options or options[opt_name] is None:
             options[opt_name] = opt_default_gen()
 
-    return DaemonContext(chroot_directory=chroot,
-                            working_directory=working_directory,
-                            umask=umask,
-                            pidfile=pidlock,
-                            uid=uid,
-                            gid=gid)
+    return DaemonContext(**options)
 
 
 def reset_signal(signal_name):