File tree 1 file changed +7
-5
lines changed
pulp_service/pulp_service/app
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
- import base64
1
+ from aiohttp . web_exceptions import HTTPFailedDependency
2
2
from storages .base import BaseStorage
3
3
from storages .utils import setting
4
4
import oras .client
@@ -40,8 +40,10 @@ def size(self, name):
40
40
41
41
def url (self , artifact_name , parameters = {}, ** kwargs ):
42
42
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 ))
47
49
return res .headers ["Location" ]
You can’t perform that action at this time.
0 commit comments