Browse Source

Preserve old umask parsing behavior so that --umask starting with 0 is octal, otherwise decimal

Ask Solem 10 years ago
parent
commit
953c9141f6
1 changed files with 2 additions and 1 deletions
  1. 2 1
      celery/platforms.py

+ 2 - 1
celery/platforms.py

@@ -296,7 +296,8 @@ class DaemonContext(object):
                  fake=False, after_chdir=None, after_forkers=True,
                  **kwargs):
         if isinstance(umask, string_t):
-            umask = int(umask, 8)  # convert str -> octal
+            # octal or decimal, depending on initial zero.
+            umask = int(umask, 8 if umask.startswith('0') else 10)
         self.workdir = workdir or DAEMON_WORKDIR
         self.umask = umask
         self.fake = fake