Skip to content
Snippets Groups Projects

Ensure deletion of Project, Resource, and FileObject

Closed Niklas Siemer requested to merge ensure_delete into master
1 unresolved thread
3 files
+ 20
11
Compare changes
  • Side-by-side
  • Inline

Files

@@ -331,14 +331,18 @@ class FileObject:
###############################################################################
def delete(self) -> None:
def delete(self, enable=False) -> None:
"""
Deletes the file-like object on the Coscine server.
"""
uri = self.client.uri("Blob", "Blob", self.resource.id)
args = {"path": self.path}
self.client.delete(uri, params = args)
if enable:
uri = self.client.uri("Blob", "Blob", self.resource.id)
args = {"path": self.path}
self.client.delete(uri, params = args)
else:
print(f"Ensure you really want to delete this file object '{self.name}' and rerun with `enable=True`.")
###############################################################################
Loading