Monday, March 19, 2012

RedHat Network rhnplugin Yum Priority Support Patch

Below is the patch one had to apply to /usr/share/yum-plugins/rhnplugin.py to support yum priorities. The most recent yum-rhn-plugin-0.9.1-36.el6.noarch doesn't need this patch anymore, thus it's of historical interest only. I didn't bother checking exactly at what plugin version did the patch become obsolete.

--- rhnplugin.py.org    2011-10-03 16:30:04.722883767 -0400
+++ rhnplugin.py        2011-10-03 16:34:28.712885617 -0400
@@ -149,6 +149,7 @@
     cachedir = conduit.getConf().cachedir
     default_gpgcheck = conduit.getConf().gpgcheck
     gpgcheck = conduit.confBool('main', 'gpgcheck', default_gpgcheck)
+    priority = conduit.confInt('main', 'priority', 1)
     sslcacert = get_ssl_ca_cert(up2date_cfg)
     enablegroups = conduit.getConf().enablegroups
     metadata_expire = conduit.getConf().metadata_expire
@@ -173,6 +174,7 @@
                     repos.delete(repo.id)
             repo.basecachedir = cachedir
             repo.gpgcheck = gpgcheck
+            repo.priority = priority
             repo.proxy = proxy_url
             repo.sslcacert = sslcacert
             repo.enablegroups = enablegroups

No comments:

Post a Comment