Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for Vagrant early #309

Open
nixjdm opened this issue Mar 15, 2018 · 0 comments
Open

Check for Vagrant early #309

nixjdm opened this issue Mar 15, 2018 · 0 comments

Comments

@nixjdm
Copy link
Member

nixjdm commented Mar 15, 2018

There's a check for the version of vagrant in the vagrantfile, but if vagrant isn't installed at all then there is a nasty error output that looks like this:

Traceback (most recent call last):
  File "/home/joe/miniconda3/envs/rambo/bin/rambo", line 11, in <module>
    load_entry_point('Rambo-vagrant', 'console_scripts', 'rambo')()
  File "/home/joe/miniconda3/envs/rambo/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/joe/miniconda3/envs/rambo/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/joe/miniconda3/envs/rambo/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/joe/miniconda3/envs/rambo/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/joe/miniconda3/envs/rambo/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/joe/miniconda3/envs/rambo/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/joe/wrkspc/rmb-prjcts/rambo/rambo/cli.py", line 127, in destroy_cmd
    app.destroy(ctx)
  File "/home/joe/wrkspc/rmb-prjcts/rambo/rambo/app.py", line 197, in destroy
    vagrant_general_command('destroy --force')
  File "/home/joe/wrkspc/rmb-prjcts/rambo/rambo/app.py", line 509, in vagrant_general_command
    _invoke_vagrant(cmd)
  File "/home/joe/wrkspc/rmb-prjcts/rambo/rambo/app.py", line 69, in _invoke_vagrant
    with Popen(cmd, stdin=slaves[0], stdout=slaves[0], stderr=slaves[1]) as p:
  File "/home/joe/miniconda3/envs/rambo/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/home/joe/miniconda3/envs/rambo/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'vagrant': 'vagrant'

This should be avoided with an early check and notification if vagrant isn't installed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant