From 571e601a570455de037456e609ca992fe7cea402 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Mon, 18 Nov 2013 13:34:04 -0500 Subject: [PATCH] deal with gpg url fallback in install Signed-off-by: Alfredo Deza --- ceph_deploy/install.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ceph_deploy/install.py b/ceph_deploy/install.py index 1768431..ac45182 100644 --- a/ceph_deploy/install.py +++ b/ceph_deploy/install.py @@ -41,9 +41,17 @@ def install(args): LOG.info('Distro info: %s %s %s', distro.name, distro.release, distro.codename) rlogger = logging.getLogger(hostname) rlogger.info('installing ceph on %s' % hostname) + + # 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 - if repo_url: + gpg_fallback = 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc' + if gpg_url is None: + LOG.warning('--gpg-url was not used, will fallback') + LOG.warning('using GPG fallback: %s', gpg_fallback) + gpg_url = gpg_fallback + + if repo_url: # triggers using a custom repository rlogger.info('using custom repository location: %s', repo_url) distro.firewall_install( distro, @@ -51,7 +59,8 @@ def install(args): gpg_url, args.adjust_repos ) - else: + + else: # otherwise a normal installation distro.install( distro, args.version_kind, @@ -242,14 +251,14 @@ def make(parser): help='hosts to install on', ) - version.add_argument( + parser.add_argument( '--repo-url', nargs='?', dest='repo_url', help='specify a repo URL that mirrors/contains ceph packages', ) - version.add_argument( + parser.add_argument( '--gpg-url', nargs='?', dest='gpg_url', -- 2.47.3