[Spacewalk-list] spacecmd system_listupgrades not working

Andreas Dijkman Andreas.Dijkman at cygnis.nl
Thu Aug 15 11:48:52 UTC 2013


Is the removal of duplicates the solution? Because default on a RHEL-derived system, RPM/YUM leaves the 3 latest kernel-packages on the system, so you can boot the system with the old kernel of the new kernel is not working for you.

Maybe the better solution would be to check if there are older packages on the system. If there are older packages and the version to which those packages could be upgraded is already present on the system, the upgrades aren't listed. This could also comes in handy if you have multiple version of a package on your system. For instance, the installation or upgrade of JDK7 by RPM doesn't remove the old versions. If you have 3 older versions of the JDK7 on your environment and not the latest, the update gets listed 4 times!! Once for every old version and once because the latest versions is not installed yet. So you get 3 false positives, the same as with the kernels.

Regards,
Andreas


________________________________________
Van: spacewalk-list-bounces at redhat.com [spacewalk-list-bounces at redhat.com] namens Tomas Lestach [tlestach at redhat.com]
Verzonden: donderdag 15 augustus 2013 10:36
Aan: spacewalk-list at redhat.com
Onderwerp: Re: [Spacewalk-list] spacecmd system_listupgrades not working

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

_______________________________________________
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