This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master
in repository copr/copr.
The following commit(s) were added to refs/heads/master by this push:
new 99e008b frontend: revert wrong optimization in createrepo
99e008b is described below
commit 99e008bc5581c121c8a3b294453664cf4039c7a8
Author: Pavel Raiskup <praiskup(a)redhat.com>
AuthorDate: Thu Dec 5 21:50:14 2019 +0100
frontend: revert wrong optimization in createrepo
CoprChrootsLogic.new_from_names() mistakenly filtered the createrepo
action by "chroots" using "dirnames" logic. So the code then
naturally
claimed something like "there's no such CoprDir=fedora-rawhide-x86_64".
We indeed want to filter by chroot on that place, but it will be done
later.
So drop the unused main_only argument from send_createrepo(), and
uncomment 'raise exceptions.NotFoundException' - it should help us
diagnose mistakenly called send_createrepo() in future.
Merges: #1146
---
frontend/coprs_frontend/coprs/logic/actions_logic.py | 14 +++++---------
frontend/coprs_frontend/coprs/logic/coprs_logic.py | 8 ++++----
2 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/logic/actions_logic.py
b/frontend/coprs_frontend/coprs/logic/actions_logic.py
index 09fa201..85a2517 100644
--- a/frontend/coprs_frontend/coprs/logic/actions_logic.py
+++ b/frontend/coprs_frontend/coprs/logic/actions_logic.py
@@ -70,21 +70,17 @@ class ActionsLogic(object):
db.session.add(action)
@classmethod
- def send_createrepo(cls, copr, dirnames=None, main_only=True):
- possible_dirnames = [copr_dir.name for copr_dir in copr.dirs
- if not main_only or copr_dir.main]
-
+ def send_createrepo(cls, copr, dirnames=None):
+ possible_dirnames = [copr_dir.name for copr_dir in copr.dirs]
if not dirnames:
# by default we createrepo for all of them
dirnames = possible_dirnames
else:
missing = set(dirnames) - set(possible_dirnames)
if missing:
- # TODO: we should raise NotFoundException here
- #raise exceptions.NotFoundException(
- # "Can't createrepo for {} in {}".format(
- # missing, copr.full_name))
- pass
+ raise exceptions.NotFoundException(
+ "Can't createrepo for {} dirnames in {}
project".format(
+ missing, copr.full_name))
data_dict = {
"ownername": copr.owner_name,
"projectname": copr.name,
diff --git a/frontend/coprs_frontend/coprs/logic/coprs_logic.py
b/frontend/coprs_frontend/coprs/logic/coprs_logic.py
index cabc9b2..6abcc43 100644
--- a/frontend/coprs_frontend/coprs/logic/coprs_logic.py
+++ b/frontend/coprs_frontend/coprs/logic/coprs_logic.py
@@ -526,7 +526,7 @@ class CoprDirsLogic(object):
copr_dir = models.CoprDir(
name=dirname, copr=copr, main=main)
- ActionsLogic.send_createrepo(copr, dirnames=[dirname], main_only=False)
+ ActionsLogic.send_createrepo(copr, dirnames=[dirname])
db.session.add(copr_dir)
return copr_dir
@@ -701,15 +701,15 @@ class CoprChrootsLogic(object):
current_chroots = copr.mock_chroots
new_chroots = cls.mock_chroots_from_names(names)
# add non-existing
- run_createrepo = []
+ run_createrepo = False
for mock_chroot in new_chroots:
if mock_chroot not in current_chroots:
db.session.add(
models.CoprChroot(copr=copr, mock_chroot=mock_chroot))
- run_createrepo.append(mock_chroot.name)
+ run_createrepo = True
if run_createrepo:
- ActionsLogic.send_createrepo(copr, dirnames=run_createrepo)
+ ActionsLogic.send_createrepo(copr)
# delete no more present
to_remove = []
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date