Révision 17f78427
Whitespace cleanup
- remove trailing whitespace
- remove empty lines at the end of files
| plugins/celery/celery_tasks | ||
|---|---|---|
| 79 | 79 |
except IOError: |
| 80 | 80 |
print 'Could not connect to the celerymon webserver' |
| 81 | 81 |
sys.exit(-1) |
| 82 |
|
|
| 82 |
|
|
| 83 | 83 |
def check_web_server_status(api_url): |
| 84 | 84 |
try: |
| 85 | 85 |
request = urllib.urlopen(api_url) |
| ... | ... | |
| 104 | 104 |
print '%s.type DERIVE' % (clean_task_name(name)) |
| 105 | 105 |
print '%s.min 0' % (clean_task_name(name)) |
| 106 | 106 |
print '%s.info number of %s tasks' % (clean_task_name(name), name) |
| 107 |
|
|
| 107 |
|
|
| 108 | 108 |
# Values |
| 109 | 109 |
def print_values(task_names = None, api_url = None): |
| 110 | 110 |
for task_name in task_names: |
| 111 | 111 |
count = len(get_data('task_details', api_url, task_name))
|
| 112 | 112 |
print '%s.value %d' % (clean_task_name(task_name), count) |
| 113 |
|
|
| 113 |
|
|
| 114 | 114 |
if __name__ == '__main__': |
| 115 | 115 |
task_names = os.environ.get('tasks', None)
|
| 116 | 116 |
api_url = os.environ.get('api_url', API_URL)
|
| 117 |
|
|
| 117 |
|
|
| 118 | 118 |
check_web_server_status(api_url) |
| 119 |
|
|
| 119 |
|
|
| 120 | 120 |
if not task_names: |
| 121 | 121 |
print 'You need to define at least one task name' |
| 122 | 122 |
sys.exit(-1) |
| 123 |
|
|
| 123 |
|
|
| 124 | 124 |
task_names = task_names.split(',')
|
| 125 |
|
|
| 125 |
|
|
| 126 | 126 |
if len(sys.argv) > 1: |
| 127 | 127 |
if sys.argv[1] == 'config': |
| 128 | 128 |
print_config(task_names) |
Formats disponibles : Unified diff