The output of `pip list --outdated` is different for pip 18. This patch
adjusts the openstack_pip provider to handle old and new versions of
pip.
Depends-On: https://review.openstack.org/646023
Change-Id: I185116a2701688860fa5ca9f8ef34d6dbecd0174
Do not split string by hyphen and change regex to match both
formats - new (with hyphen), and old one like
'pep8 (Current: 1.5.7 Latest: 1.7.0)'
Change-Id: I1eeda1b35ff35dfe8b8b0c6e948616a55f33df25
In case, when there is more than one obsoleted package, incorrect package
version is chosen.
For example:
/usr/local/bin/pip --version
pip 8.1.2 from /usr/local/lib/python2.7/dist-packages (python 2.7)
/usr/local/bin/pip list --obsolete
alabaster (0.7.6) - Latest: 0.7.8 [wheel]
Babel (1.3) - Latest: 2.3.4 [wheel]
...
tox (1.6.0) - Latest: 2.3.1 [wheel]
...
Puppet output:
Debug: Executing '/usr/local/bin/pip list --outdated'
Debug: /Stage[main]/Jenkins::Slave/Package[tox]/ensure: tox "1.6.0" is installed, latest is "0.7.8"
Debug: Executing '/usr/local/bin/pip install -q --upgrade tox'
Notice: /Stage[main]/Jenkins::Slave/Package[tox]/ensure: ensure changed '1.6.0' to '0.7.8'
Change-Id: Ia46c10ef4220be47e34c08cfd2be69e8c349f73d
Puppet providers can express what features they can provide using the
has_features variable. The declaration of features isn't inherited, so
we need to declare the features that we inherited from the core pip
provider.
Change-Id: I2f4c6254bb7f45649658d6a6b296ea1270ce6364
The upstream pip provider hard-codes pypi.python.org as the index to
search when determining the latest available release of a package. This
means puppet won't use our mirrors on the second run of a pip package
resource using ensure => latest. This patch adds a new provider that
inherits from the upstream one and overrides the latest() method to
just use `pip list --outdated` to see what the latest version is. This could
potentially be proposed upstream in the future depending on what
versions of pip support 'list --outdated' and what systems require
support.
To use this, package resources currently using the 'pip' provider will
have to switch to the 'openstack_pip' provider.
Change-Id: I6c24c8f99fb3f879a30d21f38d1ad883f96f7937