|
|
8ec79d4 |
diff --git a/server/odcs/server/pulp.py b/server/odcs/server/pulp.py
|
|
|
8ec79d4 |
index 7b4a858..ceb3f39 100644
|
|
|
8ec79d4 |
--- a/server/odcs/server/pulp.py
|
|
|
8ec79d4 |
+++ b/server/odcs/server/pulp.py
|
|
|
8ec79d4 |
@@ -71,6 +71,10 @@ class Pulp(object):
|
|
|
8ec79d4 |
for repo in repos:
|
|
|
8ec79d4 |
url = "%s/%s" % (self.server_url.rstrip('/'),
|
|
|
8ec79d4 |
repo['notes']['relative_url'])
|
|
|
8ec79d4 |
+ # OSBS cannot verify https during the container image build, so
|
|
|
8ec79d4 |
+ # fallback to http for now.
|
|
|
8ec79d4 |
+ if url.startswith("https://"):
|
|
|
8ec79d4 |
+ url = "http://" + url[len("https://"):]
|
|
|
8ec79d4 |
ret[repo["notes"]["content_set"]] = url
|
|
|
8ec79d4 |
|
|
|
8ec79d4 |
return ret
|
|
|
8ec79d4 |
diff --git a/server/tests/test_backend.py b/server/tests/test_backend.py
|
|
|
8ec79d4 |
index fe373cd..986b6ab 100644
|
|
|
8ec79d4 |
--- a/server/tests/test_backend.py
|
|
|
8ec79d4 |
+++ b/server/tests/test_backend.py
|
|
|
8ec79d4 |
@@ -30,6 +30,7 @@ from odcs.server.pdc import ModuleLookupError
|
|
|
8ec79d4 |
from odcs.server.pungi import PungiSourceType
|
|
|
8ec79d4 |
from odcs.server.backend import (resolve_compose, get_reusable_compose,
|
|
|
8ec79d4 |
generate_pulp_compose)
|
|
|
8ec79d4 |
+import odcs.server.backend
|
|
|
8ec79d4 |
from utils import ModelsBaseTest
|
|
|
8ec79d4 |
|
|
|
8ec79d4 |
from pdc import mock_pdc
|
|
|
8ec79d4 |
@@ -198,7 +199,9 @@ class TestBackend(ModelsBaseTest):
|
|
|
8ec79d4 |
c = Compose.create(
|
|
|
8ec79d4 |
db.session, "me", PungiSourceType.PULP, "foo-1 foo-2",
|
|
|
8ec79d4 |
COMPOSE_RESULTS["repository"], 3600)
|
|
|
8ec79d4 |
- generate_pulp_compose(c)
|
|
|
8ec79d4 |
+ with patch.object(odcs.server.backend.conf, 'pulp_server_url',
|
|
|
8ec79d4 |
+ "https://localhost/"):
|
|
|
8ec79d4 |
+ generate_pulp_compose(c)
|
|
|
8ec79d4 |
|
|
|
8ec79d4 |
expected_query = {
|
|
|
8ec79d4 |
"criteria": {
|
|
|
8ec79d4 |
@@ -216,13 +219,13 @@ class TestBackend(ModelsBaseTest):
|
|
|
8ec79d4 |
expected_repofile = """
|
|
|
8ec79d4 |
[foo-1]
|
|
|
8ec79d4 |
name=foo-1
|
|
|
8ec79d4 |
-baseurl=/content/1/x86_64/os
|
|
|
8ec79d4 |
+baseurl=http://localhost/content/1/x86_64/os
|
|
|
8ec79d4 |
enabled=1
|
|
|
8ec79d4 |
gpgcheck=0
|
|
|
8ec79d4 |
|
|
|
8ec79d4 |
[foo-2]
|
|
|
8ec79d4 |
name=foo-2
|
|
|
8ec79d4 |
-baseurl=/content/2/x86_64/os
|
|
|
8ec79d4 |
+baseurl=http://localhost/content/2/x86_64/os
|
|
|
8ec79d4 |
enabled=1
|
|
|
8ec79d4 |
gpgcheck=0
|
|
|
8ec79d4 |
"""
|