Skip to content
Snippets Groups Projects
Commit a001af29 authored by Nicole Parks's avatar Nicole Parks
Browse files

another way to do overwrite True/False

parent f567587b
No related branches found
No related tags found
1 merge request!20Add uption to create (POST) metadata in update_metadata function in the resource class
......@@ -625,20 +625,13 @@ class Resource:
self.put_metadata(metadata)
assert isinstance(handle, IOBase)
if overwrite:
if overwrite or path not in [f.name for f in self.files()]:
if self.type.general_type == "rdss3":
self._upload_blob_s3(path, handle)
else:
self._upload_blob(path, handle, progress)
else:
try:
self.file(path)
print('File already exists and overwrite is set to False!')
except NotFoundError:
if self.type.general_type == "rdss3":
self._upload_blob_s3(path, handle)
else:
self._upload_blob(path, handle, progress)
print('File already exists and overwrite is set to False!')
def post_metadata(self, metadata: dict) -> None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment