From e36261221cf10ebac73d168a12b5b8a535fae926 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Thu, 17 Jun 2021 14:58:01 +0200 Subject: [PATCH] Add --cid to task list Filter tasks by correlation id. fixes TBA --- CHANGES/TBA.feature | 1 + pulpcore/cli/core/generic.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 CHANGES/TBA.feature diff --git a/CHANGES/TBA.feature b/CHANGES/TBA.feature new file mode 100644 index 000000000..b87e86797 --- /dev/null +++ b/CHANGES/TBA.feature @@ -0,0 +1 @@ +Added ``--cid`` option to ``task list`` command to allow fitering by correlation id. diff --git a/pulpcore/cli/core/generic.py b/pulpcore/cli/core/generic.py index de7f1d0d3..138d3c6ac 100644 --- a/pulpcore/cli/core/generic.py +++ b/pulpcore/cli/core/generic.py @@ -4,12 +4,13 @@ import click from pulpcore.cli.common.context import ( + PluginRequirement, PulpContext, PulpEntityContext, pass_entity_context, pass_pulp_context, ) -from pulpcore.cli.common.generic import list_command +from pulpcore.cli.common.generic import list_command, pulp_option from pulpcore.cli.core.context import PulpTaskContext _ = gettext.gettext @@ -26,6 +27,12 @@ "name__contains", help=_("List only tasks whose name contains this."), ), + pulp_option( + "--cid", + "logging_cid__contains", + help=_("List only tasks with this correlation id."), + needs_plugins=[PluginRequirement("core", "3.14.0.dev")], + ), click.option( "--state", type=click.Choice(