Yum package resource/provider

I’ve run into an interesting problem with the yum package installer. In my
recipe I have:

package “Xvfb” do
action :install
end

This fails with:

/usr/lib64/ruby/gems/1.8/gems/chef-0.9.14/bin/…/lib/chef/provider/package.rb:50:in
`action_install’: No version specified, and no candidate version available
for Xvfb (Chef::Exceptions::Package)

But if I simply do :

$ sudo yum install Xvfb

It installs fine.

I saw bugs in the Chef issues tracker but they seemed to say they were fixed
and from 2009.

My client is 0.9.14 but the server is 0.9.8.

Tristan

I'd start by looking through the output of the yum_dump.py helper shipped
with chef (when Xvfb is not installed).

On Wed, Mar 9, 2011 at 10:22 AM, Tristan Sloughter <
tristan.sloughter@gmail.com> wrote:

I've run into an interesting problem with the yum package installer. In my
recipe I have:

package "Xvfb" do
action :install
end

This fails with:

/usr/lib64/ruby/gems/1.8/gems/chef-0.9.14/bin/../lib/chef/provider/package.rb:50:in
`action_install': No version specified, and no candidate version available
for Xvfb (Chef::Exceptions::Package)

But if I simply do :

$ sudo yum install Xvfb

It installs fine.

I saw bugs in the Chef issues tracker but they seemed to say they were
fixed and from 2009.

My client is 0.9.14 but the server is 0.9.8.

Tristan

I see this when I run yum_dump.py:

xorg-x11-server-Xvfb,available,0,1.1.1,48.76.el5_5.2,x86_64

On Wed, Mar 9, 2011 at 10:35 AM, Charles Duffy charles@dyfis.net wrote:

I'd start by looking through the output of the yum_dump.py helper shipped
with chef (when Xvfb is not installed).

On Wed, Mar 9, 2011 at 10:22 AM, Tristan Sloughter <
tristan.sloughter@gmail.com> wrote:

I've run into an interesting problem with the yum package installer. In my
recipe I have:

package "Xvfb" do
action :install
end

This fails with:

/usr/lib64/ruby/gems/1.8/gems/chef-0.9.14/bin/../lib/chef/provider/package.rb:50:in
`action_install': No version specified, and no candidate version available
for Xvfb (Chef::Exceptions::Package)

But if I simply do :

$ sudo yum install Xvfb

It installs fine.

I saw bugs in the Chef issues tracker but they seemed to say they were
fixed and from 2009.

My client is 0.9.14 but the server is 0.9.8.

Tristan

On Wednesday, March 9, 2011 at 9:14 AM, Tristan Sloughter wrote:
I see this when I run yum_dump.py:

xorg-x11-server-Xvfb,available,0,1.1.1,48.76.el5_5.2,x86_64
In the interest of improving this experience, how does yum know that you meant "xorg-x11-server-Xvfb" when you type yum install Xvfb?
Thanks,
--
Dan DeLeo

...so, install with the package name "xorg-x11-server-Xvfb" rather than
simply "Xvfb".

On Wed, Mar 9, 2011 at 11:14 AM, Tristan Sloughter <
tristan.sloughter@gmail.com> wrote:

I see this when I run yum_dump.py:

xorg-x11-server-Xvfb,available,0,1.1.1,48.76.el5_5.2,x86_64

On Wed, Mar 9, 2011 at 10:35 AM, Charles Duffy charles@dyfis.net wrote:

I'd start by looking through the output of the yum_dump.py helper shipped
with chef (when Xvfb is not installed).

On Wed, Mar 9, 2011 at 10:22 AM, Tristan Sloughter <
tristan.sloughter@gmail.com> wrote:

I've run into an interesting problem with the yum package installer. In
my recipe I have:

package "Xvfb" do
action :install
end

This fails with:

/usr/lib64/ruby/gems/1.8/gems/chef-0.9.14/bin/../lib/chef/provider/package.rb:50:in
`action_install': No version specified, and no candidate version available
for Xvfb (Chef::Exceptions::Package)

But if I simply do :

$ sudo yum install Xvfb

It installs fine.

I saw bugs in the Chef issues tracker but they seemed to say they were
fixed and from 2009.

My client is 0.9.14 but the server is 0.9.8.

Tristan

I expect that the xorg-x11-server-Xvfb package has Xvfb declared as a
"Provides".

On Wed, Mar 9, 2011 at 11:22 AM, Daniel DeLeo dan@kallistec.com wrote:

On Wednesday, March 9, 2011 at 9:14 AM, Tristan Sloughter wrote:

I see this when I run yum_dump.py:

xorg-x11-server-Xvfb,available,0,1.1.1,48.76.el5_5.2,x86_64

In the interest of improving this experience, how does yum know that you
meant "xorg-x11-server-Xvfb" when you type yum install Xvfb?

Thanks,

Dan DeLeo

On Wednesday, March 9, 2011 at 9:23 AM, Charles Duffy wrote:
I expect that the xorg-x11-server-Xvfb package has Xvfb declared as a "Provides".

I created an improvement request for this: http://tickets.opscode.com/browse/CHEF-2096 If you have any insight you can add to the ticket, please leave a comment.

Thanks,

--
Dan DeLeo

This is tricky though. Although I’d love to see it improved/fixed/or whatever.

Yum knows to resolve Xvfb to xorg-x11-server-Xvfb, but if you were to get the list or RPMs installed on the system, you’d get xorg-x11-server-Xvfb. Since I’m not familiar with Yum Python module, I have no idea how Chef would go about distinguishing between an RPM name that’s invalid vs. an alias for a different package name.

So far I’ve learned to deal with it or code to check for node[:platform_version].

-Paul

From: Charles Duffy <charles@dyfis.netmailto:charles@dyfis.net>
Reply-To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Date: Wed, 9 Mar 2011 11:22:48 -0600
To: Tristan Sloughter <tristan.sloughter@gmail.commailto:tristan.sloughter@gmail.com>
Cc: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Subject: [chef] Re: Re: yum package resource/provider

…so, install with the package name “xorg-x11-server-Xvfb” rather than simply “Xvfb”.

On Wed, Mar 9, 2011 at 11:14 AM, Tristan Sloughter <tristan.sloughter@gmail.commailto:tristan.sloughter@gmail.com> wrote:
I see this when I run yum_dump.py:

xorg-x11-server-Xvfb,available,0,1.1.1,48.76.el5_5.2,x86_64

On Wed, Mar 9, 2011 at 10:35 AM, Charles Duffy <charles@dyfis.netmailto:charles@dyfis.net> wrote:
I’d start by looking through the output of the yum_dump.py helper shipped with chef (when Xvfb is not installed).

On Wed, Mar 9, 2011 at 10:22 AM, Tristan Sloughter <tristan.sloughter@gmail.commailto:tristan.sloughter@gmail.com> wrote:
I’ve run into an interesting problem with the yum package installer. In my recipe I have:

package “Xvfb” do
action :install
end

This fails with:

/usr/lib64/ruby/gems/1.8/gems/chef-0.9.14/bin/…/lib/chef/provider/package.rb:50:in `action_install’: No version specified, and no candidate version available for Xvfb (Chef::Exceptions::Package)

But if I simply do :

$ sudo yum install Xvfb

It installs fine.

I saw bugs in the Chef issues tracker but they seemed to say they were fixed and from 2009.

My client is 0.9.14 but the server is 0.9.8.

Tristan

Probably the easiest way to do this from the perspective of the python code
would be to leave yum-dump as-is, and in the unusual case where we have a
package whose name we can't resolve, do a YumBase.whatProvides() call to get
the list of candidates [and use bestPackagesFromList to select from the
candidates].

On Wed, Mar 9, 2011 at 4:02 PM, Paul Choi paulchoi@plaxo.com wrote:

This is tricky though. Although I'd love to see it improved/fixed/or
whatever.

Yum knows to resolve Xvfb to xorg-x11-server-Xvfb, but if you were to get
the list or RPMs installed on the system, you'd get xorg-x11-server-Xvfb.
Since I'm not familiar with Yum Python module, I have no idea how Chef would
go about distinguishing between an RPM name that's invalid vs. an alias for
a different package name.

So far I've learned to deal with it or code to check for
node[:platform_version].

-Paul

From: Charles Duffy charles@dyfis.net
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Wed, 9 Mar 2011 11:22:48 -0600
To: Tristan Sloughter tristan.sloughter@gmail.com
Cc: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Re: Re: yum package resource/provider

...so, install with the package name "xorg-x11-server-Xvfb" rather than
simply "Xvfb".

On Wed, Mar 9, 2011 at 11:14 AM, Tristan Sloughter <
tristan.sloughter@gmail.com> wrote:

I see this when I run yum_dump.py:

xorg-x11-server-Xvfb,available,0,1.1.1,48.76.el5_5.2,x86_64

On Wed, Mar 9, 2011 at 10:35 AM, Charles Duffy charles@dyfis.net wrote:

I'd start by looking through the output of the yum_dump.py helper shipped
with chef (when Xvfb is not installed).

On Wed, Mar 9, 2011 at 10:22 AM, Tristan Sloughter <
tristan.sloughter@gmail.com> wrote:

I've run into an interesting problem with the yum package installer. In
my recipe I have:

package "Xvfb" do
action :install
end

This fails with:

/usr/lib64/ruby/gems/1.8/gems/chef-0.9.14/bin/../lib/chef/provider/package.rb:50:in
`action_install': No version specified, and no candidate version available
for Xvfb (Chef::Exceptions::Package)

But if I simply do :

$ sudo yum install Xvfb

It installs fine.

I saw bugs in the Chef issues tracker but they seemed to say they were
fixed and from 2009.

My client is 0.9.14 but the server is 0.9.8.

Tristan