Please try and keep replies on list ;o)

On Tue, 2008-04-29 at 12:36 +0100, Gerrard Geldenhuis wrote:
> > 
> > [EMAIL PROTECTED] ~]# yum list foobar
> > Loading "installonlyn" plugin
> > Loading "rhnplugin" plugin
> > Setting up repositories
> > rhel-i386-client-suppleme 100% |=========================| 1.4 kB
> > 00:00
> > rhel-i386-client-5        100% |=========================| 1.4 kB
> > 00:00
> > rhel-i386-client-workstat 100% |=========================| 1.4 kB
> > 00:00
> > Reading repository metadata in from local files
> > 
> > Those are the three repos I am connected to. "yum list" lists all
> > packages that match the word foobar - I deliberately chose something
> > that would return no results, but even if it did, it wouldn't matter
> to
> > you.
> > 
> > You can't list the repos without actually running Yum because they are
> > fetched from your satellite server via a yum plugin for RHN.
> 
> It would be handy to have a flag that can tell you what repos a machine
> would look in. Although I suppose yum list foobar is as good...
> 
> I had a quick view through the source code for yum and it looks
> relatively simple to do what I want but will probably turn out to be a
> fair bit of work...

You can't have a flag without connecting to your Satellite server,
because the list of Channels (== repos) that your client is connected to
is maintained on the Satellite Server.

The easiest way I know of getting that info from the Satellite is to run
Yum, although you could conceivably pick apart the RHN Yum plugin and
find out how to do the query directly.

The RHN plugin /usr/lib/yum-plugins/rhnplugin.py does this:
rhnChannel.getChannelDetails()

Which is imported from /usr/share/rhn/up2date_client/rhnChannel.py

... which could take a while to get to grips with ...

Alternatively, you could script it with the RHN XML-RPC api:
https://rhn.redhat.com/rhn/apidoc/channel/ChannelHandler.jsp

--
Sam

_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

Reply via email to