0001-multitenant-improve-cron-messages-57526.patch
hobo/multitenant/management/commands/tenant_command.py | ||
---|---|---|
111 | 111 |
help='Run command even if DISABLE_CRON_JOBS is set', |
112 | 112 |
) |
113 | 113 |
args_namespace, args = args_parser.parse_known_args(argv) |
114 |
try: |
|
115 |
command = args[1] |
|
116 |
except IndexError: |
|
117 |
command = 'mystery' |
|
114 | 118 | |
115 | 119 |
# Continue weirdness: parse verbosity option and also leave it in args |
116 | 120 |
# for subcommand consumption |
... | ... | |
126 | 130 |
and getattr(settings, 'DISABLE_CRON_JOBS', False) |
127 | 131 |
): |
128 | 132 |
if args_verbosity.verbosity > 1: |
129 |
print('Command %s is ignored because DISABLE_CRON_JOBS is set' % app_name)
|
|
133 |
print('Command %s is ignored because DISABLE_CRON_JOBS is set' % command)
|
|
130 | 134 |
return |
131 | 135 | |
132 | 136 |
if args_namespace.all_tenants: |
... | ... | |
136 | 140 |
if getattr(settings, 'TENANT_DISABLE_CRON_JOBS', False): |
137 | 141 |
if args_verbosity.verbosity > 1 or args_namespace.force_job: |
138 | 142 |
msg = 'Command %s is ignored on tenant %s because TENANT_DISABLE_CRON_JOBS is set' % ( |
139 |
app_name,
|
|
143 |
command,
|
|
140 | 144 |
tenant.domain_url, |
141 | 145 |
) |
142 | 146 |
prefix = '* ' |
... | ... | |
145 | 149 |
print(prefix + msg) |
146 | 150 |
continue |
147 | 151 |
if args_verbosity.verbosity > 1: |
148 |
print(u'* Running command on tenant %s' % tenant.domain_url)
|
|
152 |
print(u'* Running command %s on tenant %s' % (command, tenant.domain_url))
|
|
149 | 153 |
error = run_command_from_argv(klass, args) |
150 | 154 |
if error: |
151 | 155 |
errors.append(error) |
152 |
- |