From: Travis Rhoden Date: Thu, 28 May 2015 01:53:28 +0000 (-0400) Subject: [RM-11406] Get GPG key URL by function call X-Git-Tag: v1.5.26~20^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b035cfab605adf75e3c2cc8ef053803af348939c;p=ceph-deploy.git [RM-11406] Get GPG key URL by function call Everywhere but SUSE. SUSE requires a bit more work to handle http vs https. Signed-off-by: Travis Rhoden --- diff --git a/ceph_deploy/hosts/centos/install.py b/ceph_deploy/hosts/centos/install.py index bb91b4a..fbec63f 100644 --- a/ceph_deploy/hosts/centos/install.py +++ b/ceph_deploy/hosts/centos/install.py @@ -1,6 +1,7 @@ from ceph_deploy.util import pkg_managers, templates from ceph_deploy.lib import remoto from ceph_deploy.hosts.util import install_yum_priorities +from ceph_deploy.util.paths import gpg def rpm_dist(distro): @@ -63,7 +64,7 @@ def install(distro, version_kind, version, adjust_repos, **kw): [ 'rpm', '--import', - "https://git.ceph.com/?p=ceph.git;a=blob_plain;f=keys/{key}.asc".format(key=key) + gpg.url(key) ] ) @@ -94,7 +95,7 @@ def install(distro, version_kind, version, adjust_repos, **kw): release=release.split(".", 1)[0], machine=machine, version=version), - "https://git.ceph.com/?p=ceph.git;a=blob_plain;f=keys/{key}.asc".format(key=key), + gpg.url(key), adjust_repos=True, extra_installs=False ) diff --git a/ceph_deploy/hosts/debian/install.py b/ceph_deploy/hosts/debian/install.py index db4c431..b1ffb76 100644 --- a/ceph_deploy/hosts/debian/install.py +++ b/ceph_deploy/hosts/debian/install.py @@ -2,6 +2,7 @@ from urlparse import urlparse from ceph_deploy.lib import remoto from ceph_deploy.util import pkg_managers +from ceph_deploy.util.paths import gpg def install(distro, version_kind, version, adjust_repos, **kw): @@ -36,7 +37,7 @@ def install(distro, version_kind, version, adjust_repos, **kw): 'wget', '-O', '{key}.asc'.format(key=key), - 'https://git.ceph.com/?p=ceph.git;a=blob_plain;f=keys/{key}.asc'.format(key=key), + gpg.url(key), ], stop_on_nonzero=False, ) diff --git a/ceph_deploy/hosts/fedora/install.py b/ceph_deploy/hosts/fedora/install.py index 59a42fa..900fbab 100644 --- a/ceph_deploy/hosts/fedora/install.py +++ b/ceph_deploy/hosts/fedora/install.py @@ -1,6 +1,7 @@ from ceph_deploy.lib import remoto from ceph_deploy.hosts.centos.install import repo_install, mirror_install # noqa from ceph_deploy.hosts.util import install_yum_priorities +from ceph_deploy.util.paths import gpg def install(distro, version_kind, version, adjust_repos, **kw): @@ -26,7 +27,7 @@ def install(distro, version_kind, version, adjust_repos, **kw): [ 'rpm', '--import', - "https://git.ceph.com/?p=ceph.git;a=blob_plain;f=keys/{key}.asc".format(key=key) + gpg.url(key) ] ) @@ -64,7 +65,7 @@ def install(distro, version_kind, version, adjust_repos, **kw): release=release.split(".", 1)[0], machine=machine, version=version), - "https://git.ceph.com/?p=ceph.git;a=blob_plain;f=keys/{key}.asc".format(key=key), + gpg.url(key), adjust_repos=True, extra_installs=False ) diff --git a/ceph_deploy/install.py b/ceph_deploy/install.py index b64f3e7..49c8be2 100644 --- a/ceph_deploy/install.py +++ b/ceph_deploy/install.py @@ -6,6 +6,7 @@ from ceph_deploy import hosts from ceph_deploy.cliutil import priority from ceph_deploy.lib import remoto from ceph_deploy.util.constants import default_components +from ceph_deploy.util.paths import gpg LOG = logging.getLogger(__name__) @@ -137,7 +138,7 @@ def install(args): # custom repo arguments repo_url = os.environ.get('CEPH_DEPLOY_REPO_URL') or args.repo_url gpg_url = os.environ.get('CEPH_DEPLOY_GPG_URL') or args.gpg_url - gpg_fallback = 'https://git.ceph.com/?p=ceph.git;a=blob_plain;f=keys/release.asc' + gpg_fallback = gpg.url('release') if gpg_url is None and repo_url: LOG.warning('--gpg-url was not used, will fallback')