diff --git a/tests/test_repo/broken_deprecated/__openerp__.py b/tests/test_repo/broken_deprecated/__openerp__.py index 212840673..9a98412e9 100644 --- a/tests/test_repo/broken_deprecated/__openerp__.py +++ b/tests/test_repo/broken_deprecated/__openerp__.py @@ -3,7 +3,7 @@ 'name': 'Broken deprecated module for tests MQT', 'license': 'AGPL-3', 'author': 'Odoo Community Association (OCA)', - 'version': '8.0.0.1.0.0', + 'version': '8.0.1.0.0', 'depends': [ 'base', ], diff --git a/travis/apis.py b/travis/apis.py index 65a8adb72..790f635ce 100644 --- a/travis/apis.py +++ b/travis/apis.py @@ -2,6 +2,8 @@ import base64 import os +import re +import subprocess import tempfile import time import json @@ -54,6 +56,24 @@ def __init__(self): self.ssh = os.environ.get( "WEBLATE_SSH", "ssh://user@webpage.com") self.tempdir = os.path.join(tempfile.gettempdir(), 'weblate_api') + self._ssh_keyscan() + + def _ssh_keyscan(self): + """This method execute the command 'ssh-keysan' to avoid the + question when the command git clone is excecuted. + The question is like to: + 'Are you sure you want to continue connecting (yes/no)?'""" + cmd = ['ssh-keyscan', '-p'] + match = re.search( + r'(ssh\:\/\/\w+@(?P[\w\.]+))(:{0,1})(?P(\d+))?', + self.ssh) + if not match: + return False + data = match.groupdict() + cmd.append(data['port'] or '22') + cmd.append(data['host']) + with open(os.path.expanduser('~/.ssh/known_hosts'), 'a+') as hosts: + subprocess.Popen(cmd, stdout=hosts) def get_project(self, repo_slug, branch): self.branch = branch