-
Type:
Bug
-
Status: Closed
-
Priority:
Normal
-
Resolution: Duplicate
-
Affects Version/s: PUP 5.5.19, PUP 6.14.0
-
Fix Version/s: None
-
Component/s: Types and Providers
-
Labels:None
-
Template:
-
Acceptance Criteria:
-
Team:Night's Watch
-
Method Found:Needs Assessment
-
QA Risk Assessment:Needs Assessment
When installing a package using the yum package provider we can end-up in a situation where a package is installed from a distinct.
Trying to ensure another version, the comparison method can end-up giving the wrong result depending on package version, epoch and order of parameters.
rpm comparions: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/rpm_compare.rb#L167
usage in yum: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/package/yum.rb#L279-L284
This can be reproduced using `python-docker-pycreds` package on a redhat7 box.
Example:
- available versions: 1.10.6-1.el7, 1.10.6-3.el7 , 1.10.6-4.el7, 1:0.3.0-7.el7
- installed version: 1:0.3.0-7.el7
running:
❯ puppet resource package python-docker-pycreds ensure='1.10.6-3.el7' provider=yum
|
results in trying to use `update` flag with an older version:
Debug: Package[python-docker-pycreds](provider=yum): Upgrading package python-docker-pycreds from version 1:0.3.0-11.el7 to 1.10.6-3.el7
|
Debug: Executing: ‘/usr/bin/yum -d 0 -e 0 -y update python-docker-pycreds-1.10.6-3.el7’
|
Debug: Executing: ’/usr/bin/rpm -q python-docker-pycreds --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n’
|
Debug: Cannot parse 1.10.6-3.el7 as a RPM version range
|
Error: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead
|
Error: /Stage[main]/Main/Package[python-docker-pycreds]/ensure: change from ‘1:0.3.0-11.el7’ to ‘1.10.6-3.el7’ failed: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead
|