From 740b38cc46ca53f35a9cce6d25fff31123989586 Mon Sep 17 00:00:00 2001 From: Travis Rhoden Date: Wed, 27 May 2015 21:58:10 -0400 Subject: [PATCH] [RM-11406] Support http or https for gpg url Signed-off-by: Travis Rhoden --- ceph_deploy/tests/unit/util/test_paths.py | 4 ++++ ceph_deploy/util/constants.py | 2 +- ceph_deploy/util/paths/gpg.py | 8 ++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ceph_deploy/tests/unit/util/test_paths.py b/ceph_deploy/tests/unit/util/test_paths.py index 3ec9726..1f95dad 100644 --- a/ceph_deploy/tests/unit/util/test_paths.py +++ b/ceph_deploy/tests/unit/util/test_paths.py @@ -44,3 +44,7 @@ class TestMonPaths(object): def test_gpg_url_autobuild(self): result = paths.gpg.url('autobuild') assert result == "https://git.ceph.com/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc" + + def test_gpg_url_http(self): + result = paths.gpg.url('release', protocol="http") + assert result == "http://git.ceph.com/?p=ceph.git;a=blob_plain;f=keys/release.asc" diff --git a/ceph_deploy/util/constants.py b/ceph_deploy/util/constants.py index f440939..2acdd1e 100644 --- a/ceph_deploy/util/constants.py +++ b/ceph_deploy/util/constants.py @@ -29,4 +29,4 @@ default_components = namedtuple('DefaultComponents', ['rpm', 'deb']) default_components.rpm = tuple(_base_components + ['ceph-radosgw']) default_components.deb = tuple(_base_components + ['radosgw']) -gpg_key_base_url = "https://git.ceph.com/?p=ceph.git;a=blob_plain;f=keys/" +gpg_key_base_url = "git.ceph.com/?p=ceph.git;a=blob_plain;f=keys/" diff --git a/ceph_deploy/util/paths/gpg.py b/ceph_deploy/util/paths/gpg.py index 2115367..d9d950b 100644 --- a/ceph_deploy/util/paths/gpg.py +++ b/ceph_deploy/util/paths/gpg.py @@ -1,4 +1,8 @@ from ceph_deploy.util import constants -def url(key_type): - return "%s%s.asc" % (constants.gpg_key_base_url, key_type) +def url(key_type, protocol="https"): + return "{protocol}://{url}{key_type}.asc".format( + protocol=protocol, + url=constants.gpg_key_base_url, + key_type=key_type + ) -- 2.47.3