瀏覽代碼

Include platform in worker startup banner

Ask Solem 12 年之前
父節點
當前提交
afd7840cab
共有 4 個文件被更改,包括 14 次插入9 次删除
  1. 1 1
      celery/app/amqp.py
  2. 1 0
      celery/app/utils.py
  3. 10 6
      celery/apps/worker.py
  4. 2 2
      celery/tests/utilities/test_info.py

+ 1 - 1
celery/app/amqp.py

@@ -25,7 +25,7 @@ from . import routes as _routes
 
 #: Human readable queue declaration.
 QUEUE_FORMAT = """
-. %(name)s exchange:%(exchange)s(%(exchange_type)s) binding:%(routing_key)s
+.> %(name)s exchange:%(exchange)s(%(exchange_type)s) binding:%(routing_key)s
 """
 
 

+ 1 - 0
celery/app/utils.py

@@ -35,6 +35,7 @@ HIDDEN_SETTINGS = re.compile(
     re.IGNORECASE,
 )
 
+
 class Settings(ConfigurationView):
     """Celery settings object."""
 

+ 10 - 6
celery/apps/worker.py

@@ -14,6 +14,7 @@ from __future__ import absolute_import
 
 import logging
 import os
+import platform as _platform
 import socket
 import sys
 import warnings
@@ -74,13 +75,15 @@ ARTLINES = [
 BANNER = """\
 celery@%(hostname)s v%(version)s
 
-[Configuration]
-. broker:      %(conninfo)s
-. app:         %(app)s
-. concurrency: %(concurrency)s
-. events:      %(events)s
+%(platform)s
 
-[Queues]
+[config]
+.> broker:      %(conninfo)s
+.> app:         %(app)s
+.> concurrency: %(concurrency)s
+.> events:      %(events)s
+
+[queues]
 %(queues)s
 """
 
@@ -248,6 +251,7 @@ class Worker(configurated):
             'version': VERSION_BANNER,
             'conninfo': self.app.connection().as_uri(),
             'concurrency': concurrency,
+            'platform': _platform.platform(),
             'events': events,
             'queues': app.amqp.queues.format(indent=0, indent_first=False),
         }).splitlines()

+ 2 - 2
celery/tests/utilities/test_info.py

@@ -32,8 +32,8 @@ QUEUES = {
 }
 
 
-QUEUE_FORMAT1 = """. queue1:      exchange:exchange1(type1) binding:bind1"""
-QUEUE_FORMAT2 = """. queue2:      exchange:exchange2(type2) binding:bind2"""
+QUEUE_FORMAT1 = """.> queue1:      exchange:exchange1(type1) binding:bind1"""
+QUEUE_FORMAT2 = """.> queue2:      exchange:exchange2(type2) binding:bind2"""
 
 
 class test_Info(Case):