]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
config: add option for ceph cm ansible git url 1321/head
authorRoi Dayan <roid@mellanox.com>
Mon, 4 Apr 2016 11:25:10 +0000 (14:25 +0300)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Wed, 9 Oct 2019 17:09:41 +0000 (19:09 +0200)
This is to be able to supply a custom location without changing
the ceph git base url.

Signed-off-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
Conflicts:
teuthology/config.py
teuthology/suite.py
teuthology/test/test_suite.py

teuthology/config.py
teuthology/repo_utils.py
teuthology/suite/test/test_util.py
teuthology/task/ansible.py

index 2a26e3f4923c088ef9bc79484e19c96e051e7130..39f6847f05af4220c4e70f26dc38b78574eec335 100644 (file)
@@ -144,6 +144,7 @@ class TeuthologyConfig(YamlConfig):
         'ceph_git_base_url': 'https://github.com/ceph/',
         'ceph_git_url': None,
         'ceph_qa_suite_git_url': None,
+        'ceph_cm_ansible_git_url': None,
         'use_conserver': False,
         'conserver_master': 'conserver.front.sepia.ceph.com',
         'conserver_port': 3109,
@@ -189,6 +190,10 @@ class TeuthologyConfig(YamlConfig):
     def __init__(self, yaml_path=None):
         super(TeuthologyConfig, self).__init__(yaml_path or self.yaml_path)
 
+    def get_ceph_cm_ansible_git_url(self):
+        return (self.ceph_cm_ansible_git_url or
+                self.ceph_git_base_url + 'ceph-cm-ansible.git')
+
     def get_ceph_qa_suite_git_url(self):
         return (self.ceph_qa_suite_git_url or
                 self.get_ceph_git_url())
index 685cfa5a97f8d07dc5643a0452c737b722e9d359..bcff53af906102b85800d013be541319c8dedcd7 100644 (file)
@@ -43,6 +43,8 @@ def build_git_url(project, project_owner='ceph'):
     """
     if project == 'ceph-qa-suite':
         base = config.get_ceph_qa_suite_git_url()
+    elif project == 'ceph-cm-ansible':
+        base = config.get_ceph_cm_ansible_git_url()
     elif project == 'ceph':
         base = config.get_ceph_git_url()
     else:
index bb13ab45497ec795d90993a1a508000217e55cbb..ba7e139d320f628d11eb482fb2f6d92beeba0fd8 100644 (file)
@@ -123,6 +123,12 @@ class TestUtil(object):
         m_get_ceph_git_url.return_value = url + '.git'
         assert url == util.build_git_url('ceph')
 
+    @patch('teuthology.config.TeuthologyConfig.get_ceph_cm_ansible_git_url')
+    def test_build_git_url_ceph_cm_ansible_custom(self, m_get_ceph_cm_ansible_git_url):
+        url = 'http://foo.com/some'
+        m_get_ceph_cm_ansible_git_url.return_value = url + '.git'
+        assert url == util.build_git_url('ceph-cm-ansible')
+
     @patch('teuthology.config.TeuthologyConfig.get_ceph_git_url')
     def test_git_ls_remote(self, m_get_ceph_git_url, git_repository):
         m_get_ceph_git_url.return_value = git_repository
index 7e8227cf542470b60115eaae04388b24ce64e9df..bb611696a8d34dbfb70499fb1fcc6ea2e688eca6 100644 (file)
@@ -411,8 +411,7 @@ class CephLab(Ansible):
         if 'playbook' not in config:
             config['playbook'] = 'cephlab.yml'
         if 'repo' not in config:
-            config['repo'] = os.path.join(teuth_config.ceph_git_base_url,
-                                          'ceph-cm-ansible.git')
+            config['repo'] = teuth_config.get_ceph_cm_ansible_git_url()
         super(CephLab, self).__init__(ctx, config)
 
     def begin(self):