From 70e6d30a03a3e056bbebf4fe3b954b66b050a864 Mon Sep 17 00:00:00 2001 From: Aliaksei Klimau Date: Mon, 27 Apr 2026 16:37:49 +0200 Subject: [PATCH] Bump up pulpcore lowerbounds to 3.105 to avoid exception errors. Assisted-by: Claude Sonnet 4.6 --- CHANGES/+fix_exception_init.bugfix | 1 + pulp_gem/app/exceptions.py | 16 +++++----------- pulp_gem/app/tasks/synchronizing.py | 5 +++-- pyproject.toml | 4 ++-- 4 files changed, 11 insertions(+), 15 deletions(-) create mode 100644 CHANGES/+fix_exception_init.bugfix diff --git a/CHANGES/+fix_exception_init.bugfix b/CHANGES/+fix_exception_init.bugfix new file mode 100644 index 0000000..c8a09bf --- /dev/null +++ b/CHANGES/+fix_exception_init.bugfix @@ -0,0 +1 @@ +Bump up pulpcore lowerbounds to 3.105 to avoid exception errors. diff --git a/pulp_gem/app/exceptions.py b/pulp_gem/app/exceptions.py index 1bf745f..7df4909 100644 --- a/pulp_gem/app/exceptions.py +++ b/pulp_gem/app/exceptions.py @@ -3,17 +3,6 @@ from pulpcore.plugin.exceptions import PulpException -class RemoteURLRequiredError(PulpException): - """ - Raised when a sync is attempted without a URL on the remote. - """ - - error_code = "GEM0001" - - def __str__(self): - return f"[{self.error_code}] " + _("A remote must have a url specified to synchronize.") - - class RemoteConnectionError(PulpException): """ Raised when a connection to the remote host fails. @@ -22,6 +11,7 @@ class RemoteConnectionError(PulpException): error_code = "GEM0002" def __init__(self, host): + super().__init__() self.host = host def __str__(self): @@ -38,6 +28,7 @@ class InvalidGemNameError(PulpException): error_code = "GEM0003" def __init__(self, name): + super().__init__() self.name = name def __str__(self): @@ -52,6 +43,7 @@ class InvalidRequirementError(PulpException): error_code = "GEM0004" def __init__(self, stmt): + super().__init__() self.stmt = stmt def __str__(self): @@ -66,6 +58,7 @@ class InvalidVersionStringError(PulpException): error_code = "GEM0005" def __init__(self, version): + super().__init__() self.version = version def __str__(self): @@ -82,6 +75,7 @@ class UnknownRubyClassError(PulpException): error_code = "GEM0006" def __init__(self, suffix): + super().__init__() self.suffix = suffix def __str__(self): diff --git a/pulp_gem/app/tasks/synchronizing.py b/pulp_gem/app/tasks/synchronizing.py index d662b4b..9866bd6 100644 --- a/pulp_gem/app/tasks/synchronizing.py +++ b/pulp_gem/app/tasks/synchronizing.py @@ -5,6 +5,7 @@ from aiohttp import ClientConnectionError from django.conf import settings +from pulpcore.plugin.exceptions import SyncError from pulpcore.plugin.models import Artifact, ProgressReport, Remote, Repository from pulpcore.plugin.stages import ( DeclarativeArtifact, @@ -13,7 +14,7 @@ Stage, ) -from pulp_gem.app.exceptions import RemoteConnectionError, RemoteURLRequiredError +from pulp_gem.app.exceptions import RemoteConnectionError from pulp_gem.app.models import GemContent, GemRemote from pulp_gem.specs import ( NAME_REGEX, @@ -44,7 +45,7 @@ def synchronize(remote_pk, repository_pk, mirror=False): repository = Repository.objects.get(pk=repository_pk) if not remote.url: - raise RemoteURLRequiredError() + raise SyncError(_("A remote must have a url specified to synchronize.")) first_stage = GemFirstStage(remote) dv = DeclarativeVersion(first_stage, repository, mirror=mirror) diff --git a/pyproject.toml b/pyproject.toml index e891ba0..6f5005b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,8 +23,8 @@ classifiers=[ ] requires-python = ">=3.11" dependencies = [ - "pulpcore>=3.49.0,<3.115", - "pulp_glue_gem>=0.3.0,<0.6", + "pulpcore>=3.105.0,<3.115", + "pulp_glue_gem>=0.6.0,<0.7", "rubymarshal>=1.2.7,<1.3", ]