When we switched around how the repos worked in the YumBase object, the
handling of delete wasn't adjusted accordingly.  We should definitely be
resetting to a clean RepoStorage() object rather than setting to None.
But then should we also set it back up with the repos from the config?

Patch doing so attached, could also be convinced that callers need to
explicitly reset repos from config if they want it.  Other opinions?

Jeremy
diff --git a/yum/__init__.py b/yum/__init__.py
index 565d6c1..eb69b6a 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -344,6 +344,11 @@ class YumBase(depsolve.Depsolve):
         if doSetup:
             self._repos.doSetup(thisrepo)
         return self._repos
+
+    def _delRepos(self):
+        del self._repos
+        self._repos = RepoStorage(self)
+        self.getReposFromConfig()
     
     def doSackSetup(self, archlist=None, thisrepo=None):
         warnings.warn('doSackSetup() will go away in a future version of Yum.\n',
@@ -513,7 +518,7 @@ class YumBase(depsolve.Depsolve):
     # properties so they auto-create themselves with defaults
     repos = property(fget=lambda self: self._getRepos(),
                      fset=lambda self, value: setattr(self, "_repos", value),
-                     fdel=lambda self: setattr(self, "_repos", None))
+                     fdel=lambda self: self._delRepos())
     pkgSack = property(fget=lambda self: self._getSacks(),
                        fset=lambda self, value: setattr(self, "_pkgSack", value),
                        fdel=lambda self: self._delSacks())
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to