소스 검색

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

Ask Solem 11 년 전
부모
커밋
953c9141f6
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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