From: Vasu Kulkarni Date: Sat, 6 Jan 2018 02:04:25 +0000 (-0800) Subject: Add internal task to ignore ssl errors while X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c004a7038630b54997e19d90f5de055581b48e85;p=teuthology.git Add internal task to ignore ssl errors while cloning from untrusted gitlab Signed-off-by: Vasu Kulkarni --- diff --git a/teuthology/run.py b/teuthology/run.py index b95ce651d0..13b151fa02 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -198,6 +198,7 @@ def get_initial_tasks(lock, config, machine_type): {'internal.push_inventory': None}, {'internal.serialize_remote_roles': None}, {'internal.pre_cleanup': None}, + {'internal.git_ignore_ssl': None}, {'internal.check_conflict': None}, ]) diff --git a/teuthology/task/internal/git_ignore_ssl.py b/teuthology/task/internal/git_ignore_ssl.py new file mode 100644 index 0000000000..b7bfa3ade2 --- /dev/null +++ b/teuthology/task/internal/git_ignore_ssl.py @@ -0,0 +1,22 @@ +import contextlib +import logging + +from teuthology.orchestra import run + +log = logging.getLogger(__name__) + + +@contextlib.contextmanager +def git_ignore_ssl(ctx, config): + """ + Ignore ssl error's while cloning from untrusted http + """ + + log.info("ignoring ssl errors while cloning http repo") + ctx.cluster.run( + args=[ + 'sudo', 'git', 'config', run.Raw('--system'), + 'http.sslverify', 'false' + ], + ) + yield