[master 1/1] Fix Repository New_Repository has no mirror or baseurl (#1215963)

jkonecny12 installerbot-noreply at redhat.com
Thu Jun 4 13:59:36 UTC 2015


From: Jiri Konecny <jkonecny at redhat.com>

Source spoke is set to error state instead of crash with empty
repository.
"URL is empty" warning message is now working correctly. It shows
if new repository is created or url is not set.

Resolves: rhbz#1215963
---
 pyanaconda/packaging/dnfpayload.py | 7 +++++++
 pyanaconda/ui/gui/spokes/source.py | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
index a14725e..b1a61c0 100644
--- a/pyanaconda/packaging/dnfpayload.py
+++ b/pyanaconda/packaging/dnfpayload.py
@@ -767,6 +767,13 @@ def updateBaseRepo(self, fallback=True, checkmount=True):
                     repo.enable()
 
         for ksrepo in self.data.repo.dataList():
+            log.debug("repo %s: mirrorlist %s, baseurl %s",
+                      ksrepo.name, ksrepo.mirrorlist, ksrepo.baseurl)
+            # one of these must be set to create new repo
+            if not (ksrepo.mirrorlist or ksrepo.baseurl):
+                raise packaging.PayloadSetupError("Repository %s has no mirror or baseurl set"
+                                                  % ksrepo.name)
+
             self._add_repo(ksrepo)
 
         ksnames = [r.name for r in self.data.repo.dataList()]
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 77422f8..af9d741 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -1328,6 +1328,8 @@ def on_addRepo_clicked(self, button):
         self._repoSelection.select_iter(itr)
         self._repoEntryBox.set_sensitive(True)
 
+        self._repoURLChecks[repo].update_check_status()
+
     def on_removeRepo_clicked(self, button):
         """ Remove the selected repository
         """


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/e8adcdadf4f525b976494c3f128b246eb7c36558


More information about the anaconda-patches mailing list