]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
adding git_ignore_ssl task wip-rh-internal-tasks
authorrakeshgm <rakeshgm@redhat.com>
Wed, 13 May 2020 17:59:29 +0000 (23:29 +0530)
committerrakeshgm <rakeshgm@redhat.com>
Wed, 13 May 2020 17:59:29 +0000 (23:29 +0530)
Signed-off-by: rakeshgm <rakeshgm@redhat.com>
teuthology/task/internal/git_ignore_ssl.py [new file with mode: 0644]

diff --git a/teuthology/task/internal/git_ignore_ssl.py b/teuthology/task/internal/git_ignore_ssl.py
new file mode 100644 (file)
index 0000000..b7bfa3a
--- /dev/null
@@ -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