[Spacewalk-list] spacecmd system_listupgrades not working

Tomas Lestach tlestach at redhat.com
Thu Aug 15 08:36:23 UTC 2013


Right,

spacecmd system_listupgrades actually uses the system.listLatestUpgradablePackages API.
Output of this API you can check on your spacewalk at 
/rhn/apidoc/handlers/SystemHandler.jsp#listLatestUpgradablePackages 

basically for every installed server package, that can be upgraded following structure is returned:

string "name"
string "arch"
string "from_version"
string "from_release"
string "from_epoch"
string "to_version"
string "to_release"
string "to_epoch"
string "to_package_id"

so you see for every upgradable package the latest package to that you may upgrade.

What spacecmd system_listupgrades actually does is it returns a package list just according to "to_package_id".
So if you have multiple kernel versions installed, for all the older ones the latest kernel is offered as an
update, what causes the kernel package is listed several times.

An option would be just to remove duplicates from the list.


Regards,
--
Tomas Lestach
Red Hat Satellite Engineering, Red Hat


----- Original Message -----
> From: "Anthony J Coffman" <Tony.Coffman at snapon.com>
> To: spacewalk-list at redhat.com
> Sent: Wednesday, August 14, 2013 8:43:54 PM
> Subject: Re: [Spacewalk-list] spacecmd system_listupgrades not working
> 
> 
> 
> 
> 
> I can confirm and maybe explain what is going on. I don’t use this
> function very much but I just tried it on my Spacewalk 2.0 install.
> 
> 
> 
> Here is the spacecmd output for a system that the Spacewalk GUI said
> was up to date.
> 
> 
> 
> spacecmd {SSM:0}> system_listupgrades centos5server
> 
> kernel-PAE-2.6.18-348.12.1.el5.i686
> 
> kernel-PAE-2.6.18-348.12.1.el5.i686
> 
> 
> 
> But when I checked what kernel-PAE packages were installed, there
> were 3 installed currently on that system.
> 
> 
> 
> [root at centos5server ~]# rpm -q kernel-PAE
> 
> kernel-PAE-2.6.18-348.3.1.el5
> 
> kernel-PAE-2.6.18-348.4.1.el5
> 
> kernel-PAE-2.6.18-348.12.1.el5
> 
> 
> 
> If I remove the two older kernels and then run the listupgrades
> command it shows no updates
> 
> 
> 
> [root at centos5server ~]# rpm -e kernel-PAE-2.6.18-348.3.1.el5
> 
> [root at centos5server ~]# rpm -e kernel-PAE-2.6.18-348.4.1.el5
> 
> [root@ centos5server ~]# rhn-profile-sync
> 
> 
> 
> spacecmd {SSM:0}> system_listupgrades rich-iweb-10-rv
> 
> WARNING: No upgrades available for rich-iweb-10-rv
> 
> 
> 
> Does this explain it? it’s listing the update twice – once for each
> of the out of date kernels. The GUI must have some logic that covers
> this case that the API doesn’t have.
> 
> 
> 
> Regards,
> 
> --Tony
> 
> 
> 
> 
> 
> 
> 
> From: spacewalk-list-bounces at redhat.com
> [mailto:spacewalk-list-bounces at redhat.com] On Behalf Of Andreas
> Dijkman
> Sent: Wednesday, August 14, 2013 11:08 AM
> To: spacewalk-list at redhat.com
> Subject: [Spacewalk-list] spacecmd system_listupgrades not working
> 
> 
> 
> Hi,
> 
> 
> 
> 
> 
> We currently have some systems configured with spacewalk and wanted
> to play around with spacecmd.
> 
> 
> 
> 
> 
> The problem is the output of spacecmd system_listupgrades. Somehow
> there is a package-cache or something, because the
> system_listupgrades-command returns the list of not installed
> packages including the latest kernel-packages.
> 
> 
> 
> 
> 
> However in the spacewalk-web-GUI these updates aren't listed. Can
> someone explain or confirm this behavior? We are running Spacewalk
> 2.0 with Oracle as backend.
> 
> 
> 
> 
> 
> Met vriendelijke groet,
> 
> Andreas Dijkman
> Oracle Technical Consultant
> Phone: +31(0)50-210 0132 | Mobile: +31(0)6-8115 2982
> Cygnis | Stationsweg 3B | 9726 AC Groningen
> 
> 
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list




More information about the Spacewalk-list mailing list