multitenant: improve cron messages (#57526)
This commit is contained in:
parent
026cfba744
commit
d4123343d8
|
@ -111,6 +111,10 @@ class Command(InteractiveTenantOption, BaseCommand):
|
|||
help='Run command even if DISABLE_CRON_JOBS is set',
|
||||
)
|
||||
args_namespace, args = args_parser.parse_known_args(argv)
|
||||
try:
|
||||
command = args[1]
|
||||
except IndexError:
|
||||
command = '(unknown)'
|
||||
|
||||
# Continue weirdness: parse verbosity option and also leave it in args
|
||||
# for subcommand consumption
|
||||
|
@ -126,7 +130,7 @@ class Command(InteractiveTenantOption, BaseCommand):
|
|||
and getattr(settings, 'DISABLE_CRON_JOBS', False)
|
||||
):
|
||||
if args_verbosity.verbosity > 1:
|
||||
print('Command %s is ignored because DISABLE_CRON_JOBS is set' % app_name)
|
||||
print('Command %s is ignored because DISABLE_CRON_JOBS is set' % command)
|
||||
return
|
||||
|
||||
if args_namespace.all_tenants:
|
||||
|
@ -136,7 +140,7 @@ class Command(InteractiveTenantOption, BaseCommand):
|
|||
if getattr(settings, 'TENANT_DISABLE_CRON_JOBS', False):
|
||||
if args_verbosity.verbosity > 1 or args_namespace.force_job:
|
||||
msg = 'Command %s is ignored on tenant %s because TENANT_DISABLE_CRON_JOBS is set' % (
|
||||
app_name,
|
||||
command,
|
||||
tenant.domain_url,
|
||||
)
|
||||
prefix = '* '
|
||||
|
@ -145,7 +149,7 @@ class Command(InteractiveTenantOption, BaseCommand):
|
|||
print(prefix + msg)
|
||||
continue
|
||||
if args_verbosity.verbosity > 1:
|
||||
print(u'* Running command on tenant %s' % tenant.domain_url)
|
||||
print(u'* Running command %s on tenant %s' % (command, tenant.domain_url))
|
||||
error = run_command_from_argv(klass, args)
|
||||
if error:
|
||||
errors.append(error)
|
||||
|
|
Loading…
Reference in New Issue