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*
From: Jiri Konecny jkonecny@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 """
In reply to line 1331 of pyanaconda/ui/gui/spokes/source.py:
This should be _repoChecks, and there are actually three checks contained in it. So it should be _repoChecks[repo.name].name_check.update_check_status(), as well as .url_check and .proxy_check.
In reply to line 1331 of pyanaconda/ui/gui/spokes/source.py:
Yeah I found that. More precisely I'm going to rewrite this a little -- the warnings will be better for the user. But I have frozen the work here and doing more priority bugs now. I think the best will be to close this PR because the patch will change in the future.
Added label: master.
@@ -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()
In the Python 3 ``repo`` is not hashable and we use ``repo.name`` as the key. Just please sync with @M4rtinK to make sure whatever goes last has this glitch fixed.
Added label: check Python 3.
Looks good to me otherwise.
Added label: ACK.
Other than the two comments this seems to work fine. Since it bypasses GUIInputCheck, the delayed check changes don't affect it. It might be possible to make the addon repo checks use the delay, but that's something we can look at later.
Closed.
Will be reworked and after that new PR will be created (with the link to this one :) ).
anaconda-patches@lists.fedorahosted.org