Skip to content

Commit

Permalink
Inspect commands now accept arguments.
Browse files Browse the repository at this point in the history
Fixes #6705.
  • Loading branch information
thedrow authored and auvipy committed Apr 26, 2021
1 parent 850c62a commit 230c9ac
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions celery/bin/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def status(ctx, timeout, destination, json, **kwargs):
nodecount, text.pluralize(nodecount, 'node')))


@click.command(cls=CeleryCommand)
@click.command(cls=CeleryCommand,
context_settings={'allow_extra_args': True})
@click.argument("action", type=click.Choice([
name for name, info in Panel.meta.items()
if info.type == 'inspect' and info.visible
Expand Down Expand Up @@ -128,9 +129,12 @@ def inspect(ctx, action, timeout, destination, json, **kwargs):
"""
callback = None if json else partial(_say_remote_command_reply, ctx,
show_reply=True)
replies = ctx.obj.app.control.inspect(timeout=timeout,
arguments = _compile_arguments(action, ctx.args)
inspect = ctx.obj.app.control.inspect(timeout=timeout,
destination=destination,
callback=callback)._request(action)
callback=callback)
replies = inspect._request(action,
**arguments)

if not replies:
raise CeleryCommandException(
Expand Down

0 comments on commit 230c9ac

Please sign in to comment.