Skip to content

Commit

Permalink
Fix OSError if mech destroy #57
Browse files Browse the repository at this point in the history
  • Loading branch information
Takashi Ando authored and dodo5522 committed Aug 15, 2021
1 parent 2f74584 commit fd3bec4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mech/mech.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,10 @@ def destroy(self, arguments):
vmrun.stop(mode='hard', quiet=True)
time.sleep(3)
vmrun.deleteVM()
shutil.rmtree(mech_path)
if os.path.exists(mech_path):
shutil.rmtree(mech_path)
else:
logger.debug("{} was not found.".format(mech_path))
else:
puts_err(colored.red("Deletion aborted"))
else:
Expand Down

0 comments on commit fd3bec4

Please sign in to comment.