]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add internal task to ignore ssl errors while
authorVasu Kulkarni <vasu@redhat.com>
Sat, 6 Jan 2018 02:04:25 +0000 (18:04 -0800)
committerVasu Kulkarni <vasu@redhat.com>
Thu, 14 Feb 2019 20:28:12 +0000 (12:28 -0800)
cloning from untrusted gitlab

Signed-off-by: Vasu Kulkarni <vasu@redhat.com>
teuthology/run.py
teuthology/task/internal/git_ignore_ssl.py [new file with mode: 0644]

index b95ce651d04ffd6e9f1a0f386894efc512bab98f..13b151fa02b9941fdcc841713eb7da7fed67b658 100644 (file)
@@ -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 (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