AUTHOR
FIREWHEEL Team
DONE
DESCRIPTION
Cleans up all of the virtual machines and virtual networks started by
FIREWHEEL and ensures it is ready for another run.
DONE

RUN Python ON compute
#!/usr/bin/env python
from pathlib import Path

from firewheel.config import config

vm_resource_logs = Path(config["logging"]["root_dir"]) / config["logging"]["vmr_log_dir"]

# Create the vm_resource_log dir if it doesn't exist.
vm_resource_logs.mkdir(parents=True, exist_ok=True)

# Identify logs to delete.
# Delete log files.
for log in vm_resource_logs.iterdir():
    if not log.is_file():
        continue

    try:
        log.unlink()
    except FileNotFoundError:
        pass
    except PermissionError as exp:
        print(f"Cannot remove {log}.")
        raise exp

DONE

RUN Helpers ON compute
stop
start
DONE
