From cb4dbcb601b09824f3b966e55d0241bf70468ae7 Mon Sep 17 00:00:00 2001 From: Dominik Turecek Date: Jun 12 2019 15:03:57 +0000 Subject: Revert "[frontend] stick with the old repo_id format until F28 is supported" This reverts commit 5789379365fd5c3854e2f579bd8f5d68e8f78f51. --- diff --git a/frontend/coprs_frontend/coprs/helpers.py b/frontend/coprs_frontend/coprs/helpers.py index f446f31..cf15033 100644 --- a/frontend/coprs_frontend/coprs/helpers.py +++ b/frontend/coprs_frontend/coprs/helpers.py @@ -550,26 +550,6 @@ def get_parsed_git_url(url): return urlparse(url) -def get_copr_repo_id(copr_dir): - """ - We cannot really switch to the new - copr:{hostname}:{owner}:{project} format yet, because it is implemented in - dnf-plugins-core-3.x which is only on F29+ - - Since the F29+ plugin is able to work with both old and new formats, we can - safely stay with the old one until F28 is still supported. Once it goes EOL, - we can migrate to the new format. - - New format is: - - return "copr:{0}:{1}:{2}".format(app.config["PUBLIC_COPR_HOSTNAME"].split(":")[0], - copr_dir.copr.owner_name.replace("@", "group_"), - copr_dir.name) - - """ - return copr_dir.repo_id - - class SubdirMatch(object): def __init__(self, subdir): if not subdir: diff --git a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py index 57da1f9..1ac39d4 100644 --- a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py +++ b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py @@ -717,7 +717,9 @@ def render_generate_repo_file(copr_dir, name_release): if not mock_chroot: raise ObjectNotFound("Chroot {} does not exist".format(name_release)) - repo_id = helpers.get_copr_repo_id(copr_dir) + repo_id = "copr:{0}:{1}:{2}".format(app.config["PUBLIC_COPR_HOSTNAME"].split(":")[0], + copr_dir.copr.owner_name.replace("@", "group_"), + copr_dir.name) url = os.path.join(copr_dir.repo_url, '') # adds trailing slash repo_url = generate_repo_url(mock_chroot, url) pubkey_url = urljoin(url, "pubkey.gpg")