Issue #3538 has been updated by James Turnbull. Target version deleted (unplanned)
---------------------------------------- Bug #3538: Yum provider using "version-release" to validate installation. https://projects.puppetlabs.com/issues/3538 Author: Tony Garcia Status: Needs More Information Priority: Normal Assignee: Category: package Target version: Affected Puppet version: 0.25.4 Keywords: Branch: When using yum provider Puppet complains(error output) when using only the version(string) of the package to install or installed at the time of verification. <pre> $snmp_version = "5.3.2.2" package { "net-snmp": ensure => "${snmp_version}"; } </pre> Client output: <pre> debug: //Node[client.example.com]/snmp::base/Package[net-snmp]: Changing ensure debug: //Node[client.example.com]/snmp::base/Package[net-snmp]: 1 change(s) debug: Package[net-snmp](provider=yum): Ensuring => 5.3.2.2 **(1)** debug: Puppet::Type::Package::ProviderYum: Executing '/usr/bin/yum -d 0 -e 0 -y install net-snmp-5.3.2.2' **(2)** debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q net-snmp --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH} ' err: //Node[client.example.com]/snmp::base/Package[net-snmp]/ensure: change from 5.3.2.2-7.el5_4.2 to 5.3.2.2 failed: Could not update: Failed to update to version 5.3.2.2, got version 5.3.2.2-7.el5_4.2 instead at /opt/git/development/modules/snmp/manifests/init.pp:26 notice: //Node[client.example.com]/snmp::base/File[/etc/snmp/snmpd.conf]: Dependency package[net-snmp] has 1 failures warning: //Node[labtest40-v3.ea-colo.ea.com]/snmp::base/File[/etc/snmp/snmpd.conf]: Skipping because of failed dependencies </pre> The package is installed **(1)** but the error is still shown at the time of validation **(2)**, same situation if package is already installed. in .../provider/package/yum.rb: <pre> def install ---- chop lines --- is = self.query unless is raise Puppet::Error, "Could not find package %s" % self.name end # FIXME: Should we raise an exception even if should == :latest # and yum updated us to a version other than @param_hash[:ensure] ? if should && should != is[:ensure] raise Puppet::Error, "Failed to update to version #{should}, got version #{is[:ensure]} instead" end </pre> The error arises as **should** is not equal to **is[:ensure]** in .../provider/package/rpm.rb the query define comment says it will provide the **"version-release"** <pre> # Find the fully versioned package name and the version alone. Returns # a hash with entries :instance => fully versioned package name, and # :ensure => version-release def query </pre> The validation is made in the ensure attribute($snmp_version) string against "version-release" installed. It makes sense when somebody defines something like ensure => "${snmp_version}-${snmp-release}", but not in this use case. Tested in 0.24.8 but reported also on 0.25.4. rpm.rb and yum.rb are not behaving in the same way as yum cli behaves. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
