From a6cb7f77e5bd906aaf806db22a5aeac44e725074 Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Nov 12 2017 20:14:28 +0000 Subject: bin/get_formulas.py: don't verify the SSL cert for the gitlab.i.o.o repos We are using a freeipa created cert for gitlab.i.o.o, thus the containers created by CI runner can't verify it. This creates the issue that we can't fetch the remote. Since we plan to switch to letsencrypt wildcards as soon as they are available, it's easier for now to pass an environment variable to disable the SSL verification for this command --- diff --git a/bin/get_formulas.py b/bin/get_formulas.py index af2e78d..5ba402b 100755 --- a/bin/get_formulas.py +++ b/bin/get_formulas.py @@ -8,12 +8,16 @@ import sys import yaml -def git(cmd, cwd=None): +def git(cmd, cwd=None, additional_env=None): # pygit2 is not available for python3 in Leap, use plain git instead import subprocess - status = subprocess.call(['git'] + cmd, cwd=cwd) + env = os.environ.copy() + if additional_env: + env.update(additional_env) + + status = subprocess.call(['git'] + cmd, cwd=cwd, env=env) if status != 0: sys.exit(status) @@ -27,7 +31,8 @@ def clone_or_pull(DEST, SYMLINK=False): else: git(['clone', '-q', url, FULL_PATH]) git(['remote', 'add', 'opensuse', opensuse_fork_url], cwd=FULL_PATH) - git(['fetch', '-q', 'opensuse'], cwd=FULL_PATH) + # TODO: get rid of GIT_SSL_NO_VERIFY as soon as we switch to letsencrypt wildcard certs + git(['fetch', '-q', 'opensuse'], cwd=FULL_PATH, additional_env={'GIT_SSL_NO_VERIFY': 'true'}) def use_pygit2_to_clone_or_pull_repo(): import pygit2