From: Travis Rhoden Date: Thu, 28 May 2015 01:43:09 +0000 (-0400) Subject: [RM-11406] Add function to get ceph.com GPG Key URL X-Git-Tag: v1.5.26~20^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=13f65d8e6154f05d679c107cfc5c3a7c0b9cafdc;p=ceph-deploy.git [RM-11406] Add function to get ceph.com GPG Key URL Signed-off-by: Travis Rhoden --- diff --git a/ceph_deploy/tests/unit/util/test_paths.py b/ceph_deploy/tests/unit/util/test_paths.py index 845da22..3ec9726 100644 --- a/ceph_deploy/tests/unit/util/test_paths.py +++ b/ceph_deploy/tests/unit/util/test_paths.py @@ -36,3 +36,11 @@ class TestMonPaths(object): result = paths.mon.monmap('mycluster', 'myhostname') assert result.startswith('/') assert result.endswith('tmp/mycluster.myhostname.monmap') + + def test_gpg_url_release(self): + result = paths.gpg.url('release') + assert result == "https://git.ceph.com/?p=ceph.git;a=blob_plain;f=keys/release.asc" + + 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" diff --git a/ceph_deploy/util/constants.py b/ceph_deploy/util/constants.py index 9920dd5..f440939 100644 --- a/ceph_deploy/util/constants.py +++ b/ceph_deploy/util/constants.py @@ -28,3 +28,5 @@ default_components = namedtuple('DefaultComponents', ['rpm', 'deb']) # TODO: This needs to get unified once the packaging naming gets consistent 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/" diff --git a/ceph_deploy/util/paths/__init__.py b/ceph_deploy/util/paths/__init__.py index df19461..45095cb 100644 --- a/ceph_deploy/util/paths/__init__.py +++ b/ceph_deploy/util/paths/__init__.py @@ -1,2 +1,3 @@ import mon # noqa import osd # noqa +import gpg # noqa diff --git a/ceph_deploy/util/paths/gpg.py b/ceph_deploy/util/paths/gpg.py new file mode 100644 index 0000000..2115367 --- /dev/null +++ b/ceph_deploy/util/paths/gpg.py @@ -0,0 +1,4 @@ +from ceph_deploy.util import constants + +def url(key_type): + return "%s%s.asc" % (constants.gpg_key_base_url, key_type)