Skip to content

Commit f1d6655

Browse files
authored
Handle errors pulling from quay.io in OCI Storage backend (#495)
1 parent 2db0ee4 commit f1d6655

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pulp_service/pulp_service/app/storage.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import base64
1+
from aiohttp.web_exceptions import HTTPFailedDependency
22
from storages.base import BaseStorage
33
from storages.utils import setting
44
import oras.client
@@ -40,8 +40,10 @@ def size(self, name):
4040

4141
def url(self, artifact_name, parameters={}, **kwargs):
4242
client = oras.client.OrasClient()
43-
client.login(**self.username_password)
44-
45-
# Pull
46-
res = client.pull(target=artifact_name, return_blob_url=True, config_path="/tmp/.docker/config.json")
43+
try:
44+
client.login(**self.username_password)
45+
# Pull
46+
res = client.pull(target=artifact_name, return_blob_url=True, config_path="/tmp/.docker/config.json")
47+
except ValueError as e:
48+
raise HTTPFailedDependency(body=" ".join(e.args))
4749
return res.headers["Location"]

0 commit comments

Comments
 (0)