From 2a033eee1ce711226f67e5bf4aac3abb5b88ca0f Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Fri, 13 Sep 2024 17:17:40 +0200 Subject: [PATCH] Fixed the logic of the warning in list The warning about not all items have been shown in the list call was exactly the wrong way around. It we actually hit StopIteration, we _have_ seen them all. fixes #1068 --- CHANGES/pulp-glue/1068.bugfix | 1 + pulp-glue/pulp_glue/common/context.py | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 CHANGES/pulp-glue/1068.bugfix diff --git a/CHANGES/pulp-glue/1068.bugfix b/CHANGES/pulp-glue/1068.bugfix new file mode 100644 index 00000000..6ca3c9ee --- /dev/null +++ b/CHANGES/pulp-glue/1068.bugfix @@ -0,0 +1 @@ +Fixed the "list" commands to show the notification about not displaying all items when it shouldn't and the other way around. diff --git a/pulp-glue/pulp_glue/common/context.py b/pulp-glue/pulp_glue/common/context.py index a27c26ee..8698dd2f 100644 --- a/pulp-glue/pulp_glue/common/context.py +++ b/pulp-glue/pulp_glue/common/context.py @@ -845,6 +845,8 @@ def list(self, limit: int, offset: int, parameters: t.Dict[str, t.Any]) -> t.Lis self.list_iterator(parameters=parameters, offset=offset, stats=stats) ) except StopIteration: + pass + else: self.pulp_ctx.echo( _("Not all {count} entries were shown.").format(count=stats["count"]), err=True )