From 6c614d7842bab01699ab0053b23fa1cf9a591880 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Fri, 15 Jul 2022 12:37:13 +0200 Subject: [PATCH] Fix PARTIAL_UPDATE_ID workaround Adding ID_PREFIX to the base context models broke the heuristics of the workaround in place for translating PARTIAL_UPDATE_ID into UPDATE_ID. fixes #529 --- CHANGES/529.bugfix | 1 + pulpcore/cli/common/context.py | 2 +- pulpcore/cli/common/openapi.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 CHANGES/529.bugfix diff --git a/CHANGES/529.bugfix b/CHANGES/529.bugfix new file mode 100644 index 000000000..73b114c6e --- /dev/null +++ b/CHANGES/529.bugfix @@ -0,0 +1 @@ +Fixed the heuristics for the `PARTIAL_UPDATE_ID` workaround. diff --git a/pulpcore/cli/common/context.py b/pulpcore/cli/common/context.py index 8eedafa24..f3d7b02da 100644 --- a/pulpcore/cli/common/context.py +++ b/pulpcore/cli/common/context.py @@ -519,7 +519,7 @@ def update( non_blocking: bool = False, ) -> Any: # Workaround for plugins that do not have ID_PREFIX in place - if not hasattr(self, "ID_PREFIX") and not hasattr(self, "PARTIAL_UPDATE_ID"): + if hasattr(self, "UPDATE_ID") and not hasattr(self, "PARTIAL_UPDATE_ID"): self.PARTIAL_UPDATE_ID = getattr(self, "UPDATE_ID") # ---------------------------------------------------------- _parameters = {self.HREF: href or self.pulp_href} diff --git a/pulpcore/cli/common/openapi.py b/pulpcore/cli/common/openapi.py index 79ecbe482..fe7be444b 100644 --- a/pulpcore/cli/common/openapi.py +++ b/pulpcore/cli/common/openapi.py @@ -38,7 +38,7 @@ def __init__( ): if not validate_certs: # types-urllib3 does not cover that function - urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) # type:ignore + urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) self.debug_callback: Callable[[int, str], Any] = debug_callback or (lambda i, x: None) self.base_url: str = base_url