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
This commit is contained in:
parent
bbdd63d457
commit
2c5223cf2d
|
@ -22,6 +22,8 @@ import re
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import urllib.error
|
||||||
|
import urllib.request
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
|
@ -221,8 +223,8 @@ def main():
|
||||||
try:
|
try:
|
||||||
# Check to see if we have already imported the project into
|
# Check to see if we have already imported the project into
|
||||||
# OpenStack, if so skip checking upstream.
|
# OpenStack, if so skip checking upstream.
|
||||||
check_repo(openstack_repo, default_branch)
|
urllib.request.urlopen(openstack_repo)
|
||||||
except git.exc.GitCommandError:
|
except urllib.error.HTTPError:
|
||||||
# We haven't imported the repo yet, make sure upstream is
|
# We haven't imported the repo yet, make sure upstream is
|
||||||
# valid.
|
# valid.
|
||||||
found_errors += check_repo(upstream, default_branch)
|
found_errors += check_repo(upstream, default_branch)
|
||||||
|
|
Loading…
Reference in New Issue