[PATCH 09/14] Use temporary repo id for edited object to prevent Duplicate Repo error.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 iw/task_gui.py |    5 ++++-
 yuminstall.py  |    3 +++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/iw/task_gui.py b/iw/task_gui.py
index c0f7688..061edb7 100644
--- a/iw/task_gui.py
+++ b/iw/task_gui.py
@@ -350,7 +350,10 @@ class RepoEditor:
             # sure that if we're just editing the repo, we grab all the
             # attributes from the old one before deleting it.
             if self.repo:
-                newRepoObj = AnacondaYumRepo(self.repo.id)
+                # use temporary id so that we don't get Duplicate Repo error
+                # when adding
+                newRepoObj = AnacondaYumRepo("UIedited_%s" %
+                                             self.anaconda.backend.ayum.repoIDcounter.next())
                 removeOld = True
             else:
                 newRepoObj = AnacondaYumRepo(reponame.replace(" ", ""))
diff --git a/yuminstall.py b/yuminstall.py
index b2d168d..13c56af 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -30,6 +30,7 @@ import types
 import locale
 import glob
 import tempfile
+import itertools
 
 import rpm
 import rpmUtils
@@ -276,6 +277,8 @@ class AnacondaYum(YumSorter):
         self.anaconda = anaconda
         self._timestamp = None
 
+        self.repoIDcounter = itertools.count()
+
         # Only needed for hard drive and nfsiso installs.
         self._discImages = {}
         self.isodir = None
-- 
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux