Skip to content

Commit

Permalink
Fix OSError if mech destroy mechboxes#57
Browse files Browse the repository at this point in the history
  • Loading branch information
Takashi Ando committed May 4, 2019
1 parent ae5b012 commit f1d55f5
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 f1d55f5

Please sign in to comment.