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

global name '__env__' is not defined: modules/pip.py #6003

Closed
araddon opened this issue Jul 6, 2013 · 3 comments · Fixed by #6043
Closed

global name '__env__' is not defined: modules/pip.py #6003

araddon opened this issue Jul 6, 2013 · 3 comments · Fixed by #6043
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@araddon
Copy link

araddon commented Jul 6, 2013

using salt://myfile.txt for requirements on pip states causes this error:

graphite-pips:
  pip.installed:
    - requirements: salt://graphite/requirements.txt
    - require:
      - pkg: python-pip

error stack

    State: - pip
    Name:      graphite-pips
    Function:  installed
        Result:    False
        Comment:   An exception occurred in this state: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/salt/state.py", line 1240, in call
    ret = self.states[cdata['full']](*cdata['args'])
  File "/usr/lib/pymodules/python2.7/salt/states/pip.py", line 143, in installed
    __env__=__env__
  File "/usr/lib/pymodules/python2.7/salt/modules/pip.py", line 250, in install
    cached_requirements = _get_cached_requirements(requirements)
  File "/usr/lib/pymodules/python2.7/salt/modules/pip.py", line 56, in _get_cached_requirements
    requirements, __env__
NameError: global name '__env__' is not defined

salt-version on Master

# salt --versions-report
           Salt: 0.16.0
         Python: 2.7.3 (default, Apr 10 2013, 06:20:15)
         Jinja2: 2.6
       M2Crypto: 0.21.1
 msgpack-python: 0.1.10
   msgpack-pure: Not Installed
       pycrypto: 2.4.1
         PyYAML: 3.10
          PyZMQ: 13.0.0
            ZMQ: 3.2.2

salt-version on minion

# salt-minion --versions-report
           Salt: 0.16.0
         Python: 2.7.3 (default, Apr 10 2013, 06:20:15)
         Jinja2: 2.6
       M2Crypto: 0.21.1
 msgpack-python: 0.1.10
   msgpack-pure: Not Installed
       pycrypto: 2.4.1
         PyYAML: 3.10
          PyZMQ: 13.0.0
            ZMQ: 3.2.2
@kevinastone
Copy link
Contributor

Sorry, duplicated this issue in #6023

Am I missing something or did nobody test a pip.install before v0.16.0 got released?

terminalmage added a commit to terminalmage/salt that referenced this issue Jul 8, 2013
This fixes saltstack#6003, and resolves a traceback caused by the environment not
being passed to the function.
@terminalmage
Copy link
Contributor

Fixed in #6043.

terminalmage added a commit that referenced this issue Jul 8, 2013
This fixes #6003, and resolves a traceback caused by the environment not
being passed to the function.
@jgelens
Copy link

jgelens commented Jul 25, 2013

@kevinastone I did, a lot. But 0.16.0 broke something I guess. I didn't have this error before. Luckily the patch fixes this.

marmarek added a commit to marmarek/qubes-mgmt-salt that referenced this issue Sep 7, 2022
Salt 3005 release includes partial fix for saltstack/salt#6003, but
unfortunately it doesn't cover one corner case. Adjust the workaround to
apply for a partially-fixed version too. This is a "backport" of a fix
submitted upstream already.

Fixes QubesOS/qubes-issues#6003
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants