3434################################################################################
3535
3636@retry (wait_exponential_multiplier = 1000 , wait_exponential_max = 10000 )
37- def get_bucket (storage_service ,bucket_name ):
37+ def get_bucket (storage_service , bucket_name ):
3838 req = storage_service .buckets ().get (bucket = bucket_name )
3939 return req .execute ()
4040
4141
4242@retry (wait_exponential_multiplier = 1000 , wait_exponential_max = 10000 ,stop_max_attempt_number = 10 )
4343def delete_object (storage_service , bucket_name , object_name ):
4444 '''delete_file will delete a file from a bucket
45- :param storage_service: the service obtained with get_storage_service
46- :param bucket_name: the name of the bucket (eg singularity-hub)
47- :param object_name: the "name" parameter of the object.
45+
46+ Parameters
47+ ==========
48+ storage_service: the service obtained with get_storage_service
49+ bucket_name: the name of the bucket (eg singularity-hub)
50+ object_name: the "name" parameter of the object.
4851 '''
4952 try :
5053 operation = storage_service .objects ().delete (bucket = bucket_name ,
@@ -79,7 +82,6 @@ def upload_file(storage_service,bucket,bucket_path,file_name,verbose=True):
7982 resumable = True )
8083 request = storage_service .objects ().insert (bucket = bucket ['id' ],
8184 body = body ,
82- predefinedAcl = "publicRead" ,
8385 media_body = media )
8486 result = request .execute ()
8587 return result
@@ -100,9 +102,12 @@ def list_bucket(bucket,storage_service):
100102
101103def get_image_path (repo_url , trailing_path ):
102104 '''get_image_path will determine an image path based on a repo url, removing
103- any token, and taking into account urls that end with .git.
104- :param repo_url: the repo url to parse:
105- :param trailing_path: the trailing path (commit then hash is common)
105+ any token, and taking into account urls that end with .git.
106+
107+ Parameters
108+ ==========
109+ repo_url: the repo url to parse:
110+ trailing_path: the trailing path (commit then hash is common)
106111 '''
107112 repo_url = repo_url .split ('@' )[- 1 ].strip ()
108113 if repo_url .endswith ('.git' ):
0 commit comments