mechboxes / mech

Easy command line virtual machines for VMWare
https://mechboxes.github.io/mech/
MIT License
311 stars 49 forks source link

mech destroy has OSError after running vmrun deleteVM #57

Open dodo5522 opened 5 years ago

dodo5522 commented 5 years ago

mech destroy had OSError on my environment VMWare Fusion 11 with macOS High Sierra.
It seems that vmrun deleteVM has removed VM's instance path after vmrun deleteVM.

$ mech destroy
Are you sure you want to delete mechtest at /Users/takashi/Development/mechtest [y/N] y
Deleting...
Traceback (most recent call last):
  File "/usr/local/bin/mech", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/mech/__main__.py", line 39, in main
    return Mech(arguments)()
  File "/usr/local/lib/python2.7/site-packages/mech/command.py", line 89, in __call__
    obj = klass(arguments)
  File "/usr/local/lib/python2.7/site-packages/mech/mech.py", line 720, in destroy
    shutil.rmtree(mech_path)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 262, in rmtree
    onerror(os.listdir, path, sys.exc_info())
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 260, in rmtree
    names = os.listdir(path)
OSError: [Errno 2] No such file or directory: '/Users/takashi/Development/mechtest/.mech'