mechboxes / mech

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

mechfile is NoneType #8

Closed crowell closed 7 years ago

crowell commented 7 years ago
$ mkvirtualenv mech                                                                                                                                                         1 ↵
New python executable in /Users/jeff/.virtualenvs/mech/bin/python2.7
Also creating executable in /Users/jeff/.virtualenvs/mech/bin/python
Installing setuptools, pip, wheel...done.
virtualenvwrapper.user_scripts creating /Users/jeff/.virtualenvs/mech/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/jeff/.virtualenvs/mech/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/jeff/.virtualenvs/mech/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/jeff/.virtualenvs/mech/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/jeff/.virtualenvs/mech/bin/get_env_details
$ pip install mech
Collecting mech
  Using cached mech-0.4.1-py2-none-any.whl
Collecting clint (from mech)
Collecting args (from clint->mech)
Installing collected packages: args, clint, mech
Successfully installed args-0.1.0 clint-0.5.1 mech-0.4.1
$ mech up
Traceback (most recent call last):
  File "/usr/local/bin/mech", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/mech/__main__.py", line 92, in main
    operation(op='start', name=name, options={'gui':gui})
  File "/usr/local/lib/python2.7/site-packages/mech/__main__.py", line 54, in operation
    vmx = mechfile.get('vmx')
AttributeError: 'NoneType' object has no attribute 'get'
ColdHeat commented 7 years ago

mech up will fail if there's no mechfile in the current folder which is probably the situation here.

The way I generally use mech is to run command line VMs that I built. But you can run:

mech init https://atlas.hashicorp.com/bento/boxes/debian-8.6/versions/2.3.0/providers/vmware_desktop.box --name=bento or something like that to get one from the internets.

ColdHeat commented 7 years ago

I added an None check in 8644d2c so this isn't so ambigious but I don't think this is much of an issue beyond that. Reopen if you feel like it.