(self, path: PATH_TYPES, dry_run: bool = False)
return 0
Delete the provided path, recursively if necessary.
Delete the provided path, recursively if necessary.
Delete the provided path recursively if necessary .
def delete_file(self, path: PATH_TYPES, dry_run: bool = False) -> int:
        """Delete the provided path, recursively if necessary."""
        if not isinstance(path, pathlib.Path):
            path = pathlib.Path(path)
        log_prefix = "[DRY RUN] " if dry_run else ""
        with self.connection() as conn:
            logger.info(f"{log_prefix}Deleting item from object storage: {path}")
            if not dry_run:
                try:
                    conn.delete_object(self.default_container, path.as_posix())
                except swiftclient.exceptions.ClientException:
                    raise FileNotFoundError(path.as_posix())
        return 0
def delete_file ( self , path : PATH_TYPES , dry_run : bool = False ) -> int : if not isinstance ( path , pathlib . Path ) : path = pathlib . Path ( path ) log_prefix = "[DRY RUN] " if dry_run else "" with self . connection ( ) as conn : logger . info ( f"{log_prefix}Deleting item from object storage: {path}" ) if not dry_run : try : conn . delete_object ( self . default_container , path . as_posix ( ) ) except swiftclient . exceptions . ClientException : raise FileNotFoundError ( path . as_posix ( ) ) return 0