Update rm command

Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
Andrey Berezin 2023-01-18 15:56:01 +03:00 committed by abereziny
parent f6b128e113
commit c55c0fccb0

View file

@ -124,7 +124,9 @@ class DockerHost(Host):
volume_path = volume_info["Mountpoint"]
shell = self.get_shell()
cmd = f"rm -rf {volume_path}/meta*" if cache_only else f"rm -rf {volume_path}/*"
meta_clean_cmd = f"rm -rf {volume_path}/meta*/*"
data_clean_cmd = f"; rm -rf {volume_path}/data*/*" if not cache_only else ""
cmd = f"{meta_clean_cmd}{data_clean_cmd}"
shell.exec(cmd)
def attach_disk(self, device: str, disk_info: DiskInfo) -> None: