-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 8 Jul 2009 20:39:47 +0200
Maxim Burgerhout <[email protected]> wrote:

> This is a resend, something seems to have gone horribly wrong with the
> previous attempt...
> 
> Hi,
> 
> The patch below reverses the order in which the Python rhncfg-client
> script lists subscribed configuration channels for the current system.
> The current commandline implementation lists the channels from the
> lowest to highest rank, like this:
> 
> $ sudo rhncfg-client channels
> Config channels:
> Label                           Name
> -----                              ----
> lowest                         channel with lowest priority
> low                              channel with low priority
> high                             channel with high priority
> highest                        channel with highest priority
> 
> The Satellite / Spacewalk web-based management interface lists the
> channels the other way around. As the rhncfg-client script output has
> no indication what the order is in which the channels are listed, and
> because the order of the channels can be pretty important, I suggest a
> small fix.
> 
> Which is patching /usr/share/rhn/config_client/rpc_cli_repository.py
> like this:
> 
> --- rpc_cli_repository.py.orig  2009-07-08 15:23:28.000000000 +0200
> +++ rpc_cli_repository.py       2009-07-08 15:25:07.000000000 +0200
> @@ -53,6 +53,7 @@
>         log_debug(4)
>         self.config_channels = self.rpc_call(
>             'config.client.list_config_channels', self.system_id)
> +        self.config_channels.reverse()
>         return self.config_channels
> 
>     def list_files(self):
> 
> This makes sure self.config_channels will be filled with the
> subscribed configuration channels for the current system, in the order
> that is consistent with the web-based interface.
> 
> Mind that I made this patch against the Satellite code I have at hand
> here. I did check Spacewalk git master to see if the scripts look
> different there and they do not, so the patch should apply fine. I do
> *not* know, however, if Spacewalk returns the channels in the 'right'
> order in the first place, contrary to Satellite.
> 
> Maxim Burgerhout
> [email protected]
> ----------------
> GPG Fingerprint
> 1CC2 A9B2 FE2E 799D 01DB 8A89 0AE8 B60A ACA3 4452
> 
> _______________________________________________
> Spacewalk-devel mailing list
> [email protected]
> https://www.redhat.com/mailman/listinfo/spacewalk-devel

This is a good catch and a good idea.

I've applied the requested change but in a slightly different way.
Doing a reverse in the client tools isn't entirely reliable as it's
dependent on the order the server supplies, if anything changes there
our list is suddenly out of wack again as we're not actually sorting it.

Instead I dug up where the data originates on the server side and
changed the query to return the results sorted as with the web UI. 

Committed in 3cc55fde0273207c056868ac497f063963555b7f. 

Thanks!

Devan


- -- 
  Devan Goodwin <[email protected]>
  Software Engineer     Spacewalk / RHN Satellite
  Halifax, Canada       
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)

iEYEARECAAYFAkpcjrUACgkQAyHWaPV9my4jYQCghPJ0sspVF6CTuADlgc7hiKzw
WKkAoLmow/nKvEcxO3jpxS5+aVTR98gz
=pE6X
-----END PGP SIGNATURE-----

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

Reply via email to