Trouble with yum_package options


#1

So I think this might be a variant of
http://lists.opscode.com/sympa/arc/chef/2012-01/msg00457.html.

I am trying to do the following:
yum_package “rrdtool” do
version "1.4.7-1.el6.rfx"
options "–enablerepo=rpmforge-extras"
end

I have the rpmforge repo setup, but set to disabled. The error I get is:
“Chef::Exceptions::package: Version 1.4.7-1.el6.rfx of rrdtool not found. Did
you specify both version and release? (version-release, e.g. 1.84-10.fc6)”

If I run yum from the command line using yum install rrdtool-1.4.7-1.el6.rfx --enablerepo=rpmforge-extras the package shows as available for installation

Additional if I flip the enabled=0 to enabled=1 in the .repo file for
repoforge, the chef run sees and installs the package correctly.

Here is the debug level output of the failure

[2012-08-05T17:17:33+02:00] DEBUG: Processing yum_package[rrdtool] on localhost
[2012-08-05T17:17:33+02:00] INFO: Processing yum_package[rrdtool] action
install (zenoss::server4 line 38)
[2012-08-05T17:17:37+02:00] DEBUG: yum_package[rrdtool] checking yum info for
rrdtool-1.4.7-1.el6.rfx
[2012-08-05T17:17:37+02:00] DEBUG: yum_package[rrdtool] installed version:
(none) candidate version: 1.3.8-6.el6
[2012-08-05T17:17:37+02:00] ERROR: yum_package[rrdtool] (cookbook::recipe line
38) has had an error

From that output, I got as far as
https://github.com/opscode/chef/blob/master/chef/lib/chef/provider/package/yum.rb#L1041,
and near as I can figure out, the options passed to the resource are honored
at install time, but not during candidate determination.

I see the options used in the install method here:
https://github.com/opscode/chef/blob/master/chef/lib/chef/provider/package/yum.rb#L1056

but I can’t seem to determine how the candidate election code works, or if the
options are honored or not, but it would seem they are not.

Am I crazy here, or might this be a bug, or do I just need to go about this in
a different way?

Thanks