From 2c5223cf2dac0124d657f164521c42cade0db2f5 Mon Sep 17 00:00:00 2001 From: James Page Date: Mon, 18 Jul 2022 21:36:17 +0100 Subject: [PATCH] HTTP check existing repositories Instead of using git to check whether an existing opendev.org repository exists when and upstream source is specified, just use a simple HTTP check using urllib. This avoids any authentication style guesses git clients may make when a repo is not visible. Change-Id: Ibee29eee84ae3890a9017edf287de1415d658c39 --- tools/check_valid_gerrit_projects.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/check_valid_gerrit_projects.py b/tools/check_valid_gerrit_projects.py index 4ff290ecf4..f339510e08 100755 --- a/tools/check_valid_gerrit_projects.py +++ b/tools/check_valid_gerrit_projects.py @@ -22,6 +22,8 @@ import re import shutil import sys import tempfile +import urllib.error +import urllib.request import yaml @@ -221,8 +223,8 @@ def main(): try: # Check to see if we have already imported the project into # OpenStack, if so skip checking upstream. - check_repo(openstack_repo, default_branch) - except git.exc.GitCommandError: + urllib.request.urlopen(openstack_repo) + except urllib.error.HTTPError: # We haven't imported the repo yet, make sure upstream is # valid. found_errors += check_repo(upstream, default_branch)