kienluu/fabs

Warning on make_virtualenv command

Opened this issue · 0 comments

Here an output from the a deploy script.

[mohu@192.168.160.132] run: test -e $VIRTUALENVWRAPPER_HOOK_DIR/procor

Warning: run() received nonzero return code 1 while executing 'test -e $VIRTUALENVWRAPPER_HOOK_DIR/procor'!

[mohu@192.168.160.132] run: mkvirtualenv --no-site-packages procor
[mohu@192.168.160.132] out: The --no-site-packages flag is deprecated; it is now the default behavior.
[mohu@192.168.160.132] out: New python executable in procor/bin/python
[mohu@192.168.160.132] out: Installing distribute.............................................................................................................................................................................................done.
[mohu@192.168.160.132] out: Installing pip...............done.
[mohu@192.168.160.132] out: virtualenvwrapper.user_scripts creating /home/mohu/.virtualenvs/procor/bin/predeactivate
[mohu@192.168.160.132] out: virtualenvwrapper.user_scripts creating /home/mohu/.virtualenvs/procor/bin/postdeactivate
[mohu@192.168.160.132] out: virtualenvwrapper.user_scripts creating /home/mohu/.virtualenvs/procor/bin/preactivate
[mohu@192.168.160.132] out: virtualenvwrapper.user_scripts creating /home/mohu/.virtualenvs/procor/bin/postactivate
[mohu@192.168.160.132] out: virtualenvwrapper.user_scripts creating /home/mohu/.virtualenvs/procor/bin/get_env_details
[mohu@192.168.160.132] out: 

Virtualenv is created on error anyway.

But when virtualenv really is already created the command will fail properly as expected:

[mohu@192.168.160.132] Executing task 'test'
[mohu@192.168.160.132] run: test -e $VIRTUALENVWRAPPER_HOOK_DIR/procor
Traceback (most recent call last):
  File "/Users/kienluu/Sites/Workspace/virtualenvs/procor/lib/python2.6/site-packages/fabric/main.py", line 732, in main
    *args, **kwargs
  File "/Users/kienluu/Sites/Workspace/virtualenvs/procor/lib/python2.6/site-packages/fabric/tasks.py", line 312, in execute
    multiprocessing
  File "/Users/kienluu/Sites/Workspace/virtualenvs/procor/lib/python2.6/site-packages/fabric/tasks.py", line 211, in _execute
    return task.run(*args, **kwargs)
  File "/Users/kienluu/Sites/Workspace/virtualenvs/procor/lib/python2.6/site-packages/fabric/tasks.py", line 121, in run
    return self.wrapped(*args, **kwargs)
  File "/Users/kienluu/Sites/Workspace/Django/procor/fabfile.py", line 82, in test
    make_virtualenv()
  File "/Users/kienluu/Sites/Workspace/virtualenvs/procor/lib/python2.6/site-packages/fabric/network.py", line 523, in host_prompting_wrapper
    return func(*args, **kwargs)
  File "/Users/kienluu/Sites/Workspace/Django/procor/fabs/virtualenv.py", line 70, in make_virtualenv
    _error_on_virtualenv_exist()
  File "/Users/kienluu/Sites/Workspace/Django/procor/fabs/virtualenv.py", line 64, in _error_on_virtualenv_exist
    env.DJANGO_PROJECT_NAME)
fabs.exceptions.VirtualEnvExistError: Virtualenv procor already exist
Disconnecting from mohu@192.168.160.132... done.