소스 검색

Make sure conf.humanize() evaluates configuration. Closes #3652

Ask Solem 8 년 전
부모
커밋
cefd84a4f3
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      celery/app/utils.py

+ 10 - 0
celery/app/utils.py

@@ -163,9 +163,19 @@ class Settings(ConfigurationView):
         """
         return self['_'.join(part for part in parts if part)]
 
+    def finalize(self):
+        # See PendingConfiguration in celery/app/base.py
+        # first access will read actual configuration.
+        try:
+            self['__bogus__']
+        except KeyError:
+            pass
+        return self
+
     def table(self, with_defaults=False, censored=True):
         filt = filter_hidden_settings if censored else lambda v: v
         dict_members = dir(dict)
+        self.finalize()
         return filt({
             k: v for k, v in items(
                 self if with_defaults else self.without_defaults())