pycontribs/python-vagrant

Not running on Windows 8 - please change following code

kobe6661 opened this issue · 2 comments

Many thanks for your great tool!
I still had an issue getting this running on Windows 8. I had to change the 'get_vagrant_executable' function in C:\Pythonxx\Lib\site-packages\vagrant__init__.py to:

def get_vagrant_executable():
if (which('vagrant') is not None):
if (os.name == 'nt'):
return 'vagrant'
else:
return which('vagrant')
else:
return None

Can you include a solution to this in further versions?

Hi. Is this Konstantin Benz?

The function which tries to find the path of the vargrant executable whether it is on Windows or otherwise. I would prefer to fix that function so that it can find where your vagrant executable is.

I notice that Python 3.3 introduced a shutil.which function. See the docs and source code.

Borrowing from that implementation, I pushed a brach, windows-which, that should have a more windows compliant which. Try using that branch and seeing if it works for your Windows 8 setup. I haven't investigated how to test on Windows yet. If it doesn't work, I would be grateful if you could figure out how to fix it and make a pull request.

Regards,
Todd

This issue is resolved in v0.5.1.