Blob Blame History Raw
diff --git a/actions/packages.py b/actions/packages.py
index d4ee606..caf042c 100644
--- a/actions/packages.py
+++ b/actions/packages.py
@@ -61,6 +61,7 @@ class YumAction(yum.YumBase):
         self.doConfigSetup(debuglevel=self.cfg["debug"])
         self.cache_only = None
 
+        self.doLock()
         self.doTsSetup()
         self.doRpmDBSetup()
         self.doRepoSetup()
diff --git a/rhnplugin.py b/rhnplugin.py
index 8f1cba0..d238301 100644
--- a/rhnplugin.py
+++ b/rhnplugin.py
@@ -163,7 +163,6 @@ def init_hook(conduit):
     repos = conduit.getRepos()
     cachedir = conduit_conf.cachedir
     sslcacert = get_ssl_ca_cert(up2date_cfg)
-    pluginOptions = getRHNRepoOptions(conduit, 'main')
 
     cachefile = openRHNReposCache(conduit)
     for channel in svrChannels:
@@ -181,16 +180,7 @@ def init_hook(conduit):
                 repo.timeout = timeout
             if hasattr(conduit_conf, '_repos_persistdir'):
                 repo.base_persistdir = conduit_conf._repos_persistdir
-            repoOptions = getRHNRepoOptions(conduit, repo.id)
-            for options in [pluginOptions, repoOptions]:
-                if options:
-                    for o in options:
-                        if o[0] == 'exclude': # extend current list
-                            setattr(repo, o[0], ",".join(repo.exclude) + ',' + o[1])
-                        else: # replace option
-                            setattr(repo, o[0], o[1])
-                        conduit.info(5, "Repo '%s' setting option '%s' = '%s'" %
-                            (repo.id, o[0], o[1]))
+            updateRHNRepoOptions(conduit, repo)
             repos.add(repo)
             if cachefile:
                 cachefile.write("%s %s\n" % (repo.id, repo.name))
@@ -242,6 +232,7 @@ def addCachedRepos(conduit):
             repo.name = reponame
             if hasattr(conduit.getConf(), '_repos_persistdir'):
                 repo.base_persistdir = conduit.getConf()._repos_persistdir
+            updateRHNRepoOptions(conduit, repo)
             repo.enable()
             if not repos.findRepos(repo.id):
                 repos.add(repo)
@@ -466,7 +457,8 @@ class RhnRepo(YumRepository):
                                       http_headers=headers,
                                       ssl_ca_cert = self.sslcacert.encode('utf-8'),
                                       timeout=self.timeout,
-                                      size = size
+                                      size = size,
+                                      retry_no_cache=self._retry_no_cache
                                       )
             return result
 
@@ -490,7 +482,8 @@ class RhnRepo(YumRepository):
                                           http_headers=headers,
                                           ssl_ca_cert = self.sslcacert.encode('utf-8'),
                                           timeout=self.timeout,
-                                          size = size
+                                          size = size,
+                                          retry_no_cache=self._retry_no_cache
                                           )
                 return result
             except URLGrabError, e:
@@ -755,6 +748,19 @@ def getRHNRepoOptions(conduit, repoid):
         pass
     return None
 
+def updateRHNRepoOptions(conduit, repo):
+    pluginOptions = getRHNRepoOptions(conduit, 'main')
+    repoOptions = getRHNRepoOptions(conduit, repo.id)
+    for options in [pluginOptions, repoOptions]:
+        if options:
+            for o in options:
+                if o[0] == 'exclude': # extend current list
+                    setattr(repo, o[0], ",".join(repo.exclude) + ',' + o[1])
+                else: # replace option
+                    setattr(repo, o[0], o[1])
+                conduit.info(5, "Repo '%s' setting option '%s' = '%s'" %
+                    (repo.id, o[0], o[1]))
+
 def config_hook(conduit):
     if hasattr(conduit, 'registerPackageName'):
         conduit.registerPackageName("yum-rhn-plugin")
diff --git a/yum-rhn-plugin.spec b/yum-rhn-plugin.spec
index 83c64d8..b5531e6 100644
--- a/yum-rhn-plugin.spec
+++ b/yum-rhn-plugin.spec
@@ -1,7 +1,7 @@
 Summary: Spacewalk support for yum
 Name: yum-rhn-plugin
 Version: 2.0.1
-Release: 7%{?dist}
+Release: 8%{?dist}
 License: GPLv2
 Group: System Environment/Base
 Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -70,6 +70,14 @@ fi
 %doc LICENSE
 
 %changelog
+* Mon Mar 06 2017 Gennadii Altukhov <galt@redhat.com> 2.0.1-8
+- Resolves: #1398406 - update repo options from rhnplugin.conf even in
+  cacheonly mode (michael.mraka@redhat.com)
+- Resolves: #1391867 - pass retry_no_cache option to urlgrabber
+  (michael.mraka@redhat.com)
+- Resolves: #1361185 - use yum's lock to prevent concurent yum & rhn_check
+  actions (michael.mraka@redhat.com)
+
 * Mon Feb 20 2017 Tomas Kasparek <tkasparek@redhat.com> 2.0.1-7
 - Resolves: #1423007 - request failed: error reading the headers
   (CVE-2016-8743) (pstudeni@redhat.com)