Skip to content
Snippets Groups Projects
Commit 0819d5d0 authored by Charlotte Hausman's avatar Charlotte Hausman
Browse files

catch the case were directory no longer exists

parent 3f1d5a93
No related branches found
No related tags found
1 merge request!1299catch the case where directory no longer exists
Pipeline #9352 canceled
......@@ -117,10 +117,13 @@ class CapoInjector:
def clear_subspace(self):
logger.info(f"Clearing capo subspace file from {self.dir_path.__str__()}...")
for file in os.listdir(self.dir_path):
if file.endswith(".properties"):
Path.unlink(self.dir_path / file)
check = glob.glob("*.properties")
if check is None:
logger.info("Capo subspace cleared successfully.")
if Path(self.dir_path).exists():
for file in os.listdir(self.dir_path):
if file.endswith(".properties"):
Path.unlink(self.dir_path / file)
check = glob.glob("*.properties")
if check is None:
logger.info("Capo subspace cleared successfully.")
else:
logger.info(f"Directory {self.dir_path} has already been cleaned.")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment