salt icon indicating copy to clipboard operation
salt copied to clipboard

pip.installed can't check version of pip installed

Open dlindquist opened this issue 13 years ago • 14 comments

State:

.install_newer_pip:
  pip.installed:
    - name: pip==1.2.1
    - upgrade: True

Output from second run:

    State: - pip
    Name:      pip==1.2.1
    Function:  installed
        Result:    True
        Comment:   There was no error installing package '"pip==1.2.1"' although it does not show when calling 'pip.freeze'.
        Changes:   "pip==1.2.1"==???: Installed

Expected output:

    State: - pip
    Name:      pip==1.2.1
    Function:  installed
        Result:    True
        Comment:   Comment:   Package already installed
        Changes:   

Version:

$ salt-minion --versions-report
           Salt: 0.15.3
         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: 2.1.11
            ZMQ: 2.1.11

dlindquist avatar Aug 21 '13 19:08 dlindquist

Interesting edge case. Thanks for the report.

basepi avatar Aug 21 '13 22:08 basepi

Wait, can pip actually install itself? I don't actually understand what's going on here. =P

basepi avatar Aug 21 '13 22:08 basepi

Indeed, it's an edge case. In this case, it was system pip installing the latest pip via pypi. But, I would think that pip could install pip...

dlindquist avatar Aug 21 '13 23:08 dlindquist

pip is definitely able to upgrade itself

cvrebert avatar Aug 21 '13 23:08 cvrebert

Hehe, TIL.

This edge case shouldn't be too difficult.

basepi avatar Aug 22 '13 15:08 basepi

On 21-08-2013 20:06, David Lindquist wrote:

State:

|.install_newer_pip: pip.installed: - name: pip==1.2.1 - upgrade: True |

Output from second run:

| State: - pip Name: pip==1.2.1 Function: installed Result: True Comment: There was no error installing package '"pip==1.2.1"' although it does not show when calling 'pip.freeze'. Changes: "pip==1.2.1"==???: Installed |

Expected output:

| State: - pip Name: pip==1.2.1 Function: installed Result: True Comment: Comment: Package already installed Changes:
|

Version:

|$ salt-minion --versions-report Salt: 0.15.3 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: 2.1.11 ZMQ: 2.1.11 |

— Reply to this email directly or view it on GitHub https://github.com/saltstack/salt/issues/6833.

The current develop branch of salt has a lot of changes both to the pip state and module. Would it be possible to confirm if it also happens with latest stable or preferably with the develop git branch?

Pedro Algarvio Pedro Algarvio Email me @algarvio.me mailto:[email protected] // Find me on LinkedIn http://www.linkedin.com/in/pedroalgarvio // Find me on Twitter https://twitter.com/s0undt3ch // Find me on GitHub https://github.com/s0undt3ch // Find me on BitBucket https://bitbucket.org/s0undt3ch // Find me on Ohloh https://www.ohloh.net/accounts/s0undt3ch // Like my work? Tip me on GitTip https://www.gittip.com/s0undt3ch

s0undt3ch avatar Aug 22 '13 16:08 s0undt3ch

Still happens with latest stable from the Debian package repo, version 0.16.3-1~bpo70+1~dst.1

    State: - pip
    Name:      pip==1.4.1
    Function:  installed
        Result:    True
        Comment:   There was no error installing package '"pip==1.4.1"' although it does not show when calling 'pip.freeze'.
        Changes:   "pip==1.4.1"==???: Installed

gthb avatar Aug 29 '13 09:08 gthb

Yes, latest git develop is what has lot's of changes to the pip state and module, salt 0.16.3 and lower are expected to fail as you stated.

s0undt3ch avatar Aug 29 '13 10:08 s0undt3ch

http://jenkins.saltstack.com/job/salt-rs-ubuntu12.04/34/console

s0undt3ch avatar Sep 09 '13 22:09 s0undt3ch

Yes, I'm very much aware that I broke all the things by merging that. Trying to figure out how to fix it, thinking I'm going to have to revert for now.

basepi avatar Sep 09 '13 22:09 basepi

Sorry for just dropping the URL, but your start of day almost matches my end of day and by then I was trying to make the remaining energy last longer ;)

#7143

s0undt3ch avatar Sep 10 '13 10:09 s0undt3ch

Thanks for the fix and test case on this, @s0undt3ch !

dlanderson avatar Sep 10 '13 16:09 dlanderson

No worries :smile:

s0undt3ch avatar Sep 10 '13 17:09 s0undt3ch

This has been fixed. Closing.

s0undt3ch avatar Sep 21 '13 14:09 s0undt3ch