salt: pip state broken in 2015.8.9 with pip <6.0

Description

pip state fails with AttributeError in Salt 2015.8.9 with pip < 6.0

Setup

Ubuntu Trusty python-pip installed from mainline apt (pip 1.5.4)

Steps to Reproduce Issue

Run a state with pip.installed in it with pip 1.5.4 installed on the system.

Versions Report

# salt-call --versions-report
Salt Version:
           Salt: 2015.8.9

Dependency Versions:
         Jinja2: 2.7.2
       M2Crypto: Not Installed
           Mako: 0.9.1
         PyYAML: 3.10
          PyZMQ: 14.0.1
         Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
           RAET: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.4
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 1.5
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
        libgit2: Not Installed
        libnacl: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.3.0
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
   python-gnupg: Not Installed
          smmap: Not Installed
        timelib: Not Installed

System Versions:
           dist: Ubuntu 14.04 trusty
        machine: x86_64
        release: 4.2.0-35-generic
         system: Ubuntu 14.04 trusty

Stack trace from the minion output:

    Function: pip.installed
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1624, in call
                  **cdata['kwargs'])
                File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1492, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python2.7/dist-packages/salt/states/pip_state.py", line 597, in installed
                  out = _check_pkg_version_format(pkg)
                File "/usr/lib/python2.7/dist-packages/salt/states/pip_state.py", line 181, in _check_pkg_version_format
                  specifier = install_req.req.specifier
              AttributeError: Requirement instance has no attribute 'specifier'
     Started: 20:19:45.883326
    Duration: 3.61 ms
     Changes:

Relevant code in pip: https://github.com/pypa/pip/blob/1.5.6/pip/req.py#L170

As you can see, req is a string.

I posted all this as comments on #33180, then realized I should open an issue. Sorry about that.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

Yes, for the record this hit us out of nowhere because of an upstream change and are working on this right now

I have confirmed that reverting https://github.com/saltstack/salt/pull/33180 fixes this issue.