From 8ec79d4b4ca94dfe678b8dfd7c366a1bb197dc61 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Oct 12 2017 07:35:39 +0000 Subject: use http instead of https for pulp .repo file --- diff --git a/odcs-pulp-http.patch b/odcs-pulp-http.patch new file mode 100644 index 0000000..45e7a83 --- /dev/null +++ b/odcs-pulp-http.patch @@ -0,0 +1,54 @@ +diff --git a/server/odcs/server/pulp.py b/server/odcs/server/pulp.py +index 7b4a858..ceb3f39 100644 +--- a/server/odcs/server/pulp.py ++++ b/server/odcs/server/pulp.py +@@ -71,6 +71,10 @@ class Pulp(object): + for repo in repos: + url = "%s/%s" % (self.server_url.rstrip('/'), + repo['notes']['relative_url']) ++ # OSBS cannot verify https during the container image build, so ++ # fallback to http for now. ++ if url.startswith("https://"): ++ url = "http://" + url[len("https://"):] + ret[repo["notes"]["content_set"]] = url + + return ret +diff --git a/server/tests/test_backend.py b/server/tests/test_backend.py +index fe373cd..986b6ab 100644 +--- a/server/tests/test_backend.py ++++ b/server/tests/test_backend.py +@@ -30,6 +30,7 @@ from odcs.server.pdc import ModuleLookupError + from odcs.server.pungi import PungiSourceType + from odcs.server.backend import (resolve_compose, get_reusable_compose, + generate_pulp_compose) ++import odcs.server.backend + from utils import ModelsBaseTest + + from pdc import mock_pdc +@@ -198,7 +199,9 @@ class TestBackend(ModelsBaseTest): + c = Compose.create( + db.session, "me", PungiSourceType.PULP, "foo-1 foo-2", + COMPOSE_RESULTS["repository"], 3600) +- generate_pulp_compose(c) ++ with patch.object(odcs.server.backend.conf, 'pulp_server_url', ++ "https://localhost/"): ++ generate_pulp_compose(c) + + expected_query = { + "criteria": { +@@ -216,13 +219,13 @@ class TestBackend(ModelsBaseTest): + expected_repofile = """ + [foo-1] + name=foo-1 +-baseurl=/content/1/x86_64/os ++baseurl=http://localhost/content/1/x86_64/os + enabled=1 + gpgcheck=0 + + [foo-2] + name=foo-2 +-baseurl=/content/2/x86_64/os ++baseurl=http://localhost/content/2/x86_64/os + enabled=1 + gpgcheck=0 + """ diff --git a/odcs.spec b/odcs.spec index 6921c0f..096b207 100644 --- a/odcs.spec +++ b/odcs.spec @@ -3,7 +3,7 @@ Name: odcs Version: 0.1.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The On Demand Compose Service @@ -18,6 +18,7 @@ Source1: odcs-backend.service Patch0: odcs-pythonldap.patch # Fedora related configuration for ODCS. Patch1: odcs-fedora-conf.patch +Patch2: odcs-pulp-http.patch %if 0%{?rhel} && 0%{?rhel} <= 7 # In EL7 we need flask which needs python-itsdangerous which comes from @@ -170,6 +171,7 @@ Client library for sending requests to On Demand Compose Service (ODCS). %patch0 -p1 -b .pyldap %patch1 -p1 +%patch2 -p1 %build @@ -248,6 +250,9 @@ exit 0 %changelog +* Thu Oct 12 2017 Jan Kaluza - 0.1.0-2 +- use http instead of https for pulp .repo file + * Fri Oct 06 2017 Ralph Bean - 0.1.0-1 - new version