Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/+fix_exception_init.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bump up pulpcore lowerbounds to 3.105 to avoid exception errors.
16 changes: 5 additions & 11 deletions pulp_gem/app/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -22,6 +11,7 @@ class RemoteConnectionError(PulpException):
error_code = "GEM0002"

def __init__(self, host):
super().__init__()
self.host = host

def __str__(self):
Expand All @@ -38,6 +28,7 @@ class InvalidGemNameError(PulpException):
error_code = "GEM0003"

def __init__(self, name):
super().__init__()
self.name = name

def __str__(self):
Expand All @@ -52,6 +43,7 @@ class InvalidRequirementError(PulpException):
error_code = "GEM0004"

def __init__(self, stmt):
super().__init__()
self.stmt = stmt

def __str__(self):
Expand All @@ -66,6 +58,7 @@ class InvalidVersionStringError(PulpException):
error_code = "GEM0005"

def __init__(self, version):
super().__init__()
self.version = version

def __str__(self):
Expand All @@ -82,6 +75,7 @@ class UnknownRubyClassError(PulpException):
error_code = "GEM0006"

def __init__(self, suffix):
super().__init__()
self.suffix = suffix

def __str__(self):
Expand Down
5 changes: 3 additions & 2 deletions pulp_gem/app/tasks/synchronizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]

Expand Down