]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-12553] repo: Allow URLs to be passed by env var
authorTravis Rhoden <trhoden@redhat.com>
Tue, 4 Aug 2015 18:34:17 +0000 (11:34 -0700)
committerTravis Rhoden <trhoden@redhat.com>
Tue, 4 Aug 2015 19:29:40 +0000 (12:29 -0700)
This is more secure if the repo URL contains a user:pass combo

Refs: #12553

Signed-off-by: Travis Rhoden <trhoden@redhat.com>
ceph_deploy/repo.py

index f40806ae53a996879dc8e5c0618f128d92b0ffca..9fd5c3580d491092a8d386cd56c4820314f0e326 100644 (file)
@@ -1,3 +1,4 @@
+import os
 import logging
 
 from ceph_deploy import hosts
@@ -20,8 +21,8 @@ def install_repo(distro, args, cd_conf, rlogger):
                 'missing required key: %s in config section: %s' % (err, args.repo_name)
             )
     else:
-        repo_url = args.repo_url
-        gpg_url = args.gpg_url
+        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
         extra_repos = []
 
     repo_url = repo_url.strip('/')  # Remove trailing slashes