From: Alfredo Deza Date: Thu, 13 Mar 2014 19:41:20 +0000 (-0400) Subject: use custom repo from conf if THE UNIVERSE is aligned with us X-Git-Tag: v1.4.0~5^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8350a0a3ede11be793a6d6d26513e11569e61a93;p=ceph-deploy.git use custom repo from conf if THE UNIVERSE is aligned with us Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/install.py b/ceph_deploy/install.py index 3d16329..8ff77d5 100644 --- a/ceph_deploy/install.py +++ b/ceph_deploy/install.py @@ -76,8 +76,8 @@ def install(args): ) # Detect and install custom repos here if needed - elif cd_conf and cd_conf.has_repos and not repo_url: - LOG.info('detected custom repositories from config file') + elif should_use_custom_repo(args, cd_conf, repo_url): + LOG.info('detected valid custom repositories from config file') custom_repo(distro, args, cd_conf, rlogger) else: # otherwise a normal installation @@ -93,6 +93,23 @@ def install(args): distro.conn.exit() +def should_use_custom_repo(args, cd_conf, repo_url): + """ + A boolean to determine the logic needed to proceed with a custom repo + installation instead of cramming everything nect to the logic operator. + """ + if repo_url: + # repo_url signals a CLI override, return False immediately + return False + if cd_conf: + if cd_conf.has_repos: + has_valid_release = args.release in cd_conf.get_repos() + has_default_repo = cd_conf.get_default_repo() + if has_valid_release or has_default_repo: + return True + return False + + def custom_repo(distro, args, cd_conf, rlogger): """ A custom repo install helper that will go through config checks to retrieve