Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

pip module is broken in current git master #1922

Closed
mitsuhiko opened this Issue · 7 comments

3 participants

@mitsuhiko
        Comment:   An exception occured in this state: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/salt/state.py", line 827, in call
    ret = self.states[cdata['full']](*cdata['args'])
  File "/usr/local/lib/python2.7/dist-packages/salt/states/virtualenv.py", line 109, in managed
    requirements=requirements, bin_env=name, runas=runas, cwd=cwd
  File "/usr/local/lib/python2.7/dist-packages/salt/modules/pip.py", line 163, in install
    fd_, treq = tempfile.mkstemp()
NameError: global name 'tempfile' is not defined
@mitsuhiko

There is another name error in the pip module. shutil is not imported. WTF.

@mitsuhiko
diff --git a/salt/modules/pip.py b/salt/modules/pip.py
index 264b881..2222475 100644
--- a/salt/modules/pip.py
+++ b/salt/modules/pip.py
@@ -3,6 +3,8 @@ Install Python packages with pip to either the system or a virtualenv
 '''

 import os
+import shutil
+import tempfile
 from salt.exceptions import CommandExecutionError

 def _get_pip_bin(bin_env):
@mitsuhiko

This is the 5th name error I think I have encountered this week in salt. Why are there no tests for this?

@thatch45 thatch45 closed this issue from a commit
@thatch45 thatch45 fix #1922 a23b979
@thatch45 thatch45 closed this in a23b979
@thatch45
Owner

There are tests for this, but I am behind on git right now because too much is going on

@mitsuhiko

Fair enough. For what it's worth with the changes you did now and some changes in the salt states the system is much more stable now than it was before. We now have more issues with upstart than salt :-)

@thatch45
Owner

Thanks for the help, things have been very crazy on the salt front, the community keep growing and I am working to change some things to make everything more manageable. I plan on spending a lot of resources on making things better tested and more stable in future releases since the features seem to be well filled out.

@scott-w

Further to this, I'm getting the following issue in the latest salt-daily:

        Comment:   An exception occured in this state: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/salt/state.py", line 824, in call
    ret = self.states[cdata['full']](*cdata['args'])
  File "/usr/lib/pymodules/python2.7/salt/states/virtualenv.py", line 109, in managed
    requirements=requirements, bin_env=name, runas=runas, cwd=cwd
  File "/usr/lib/pymodules/python2.7/salt/modules/pip.py", line 171, in install
    cmd=cmd, requirements=treq)
UnboundLocalError: local variable 'treq' referenced before assignment

I have a fix on my local instance, so I'll push out a fix when I get a bit of time.

@scott-w scott-w referenced this issue from a commit in scott-w/salt
Scott Walton Fix for ValueError in #1922 fcfa89e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.