Locate the repo we're using; cloning it from a remote repo if necessary
"""
repo = self.config.get('repo', '.')
- if repo.startswith(('http://', 'https://', 'git@')):
+ if repo.startswith(('http://', 'https://', 'git@', 'git://')):
repo_path = fetch_repo(
repo,
self.config.get('branch', 'master'),
task.find_repo()
assert task.repo_path == os.path.expanduser(task_config['repo'])
+ @patch('teuthology.task.ansible.fetch_repo')
+ def test_find_repo_path_remote(self, m_fetch_repo):
+ task_config = dict(
+ repo='git://fake_host/repo.git',
+ )
+ m_fetch_repo.return_value = '/tmp/repo'
+ task = Ansible(self.ctx, task_config)
+ task.find_repo()
+ assert task.repo_path == os.path.expanduser('/tmp/repo')
+
@patch('teuthology.task.ansible.fetch_repo')
def test_find_repo_http(self, m_fetch_repo):
task_config = dict(