diff --git a/modules/openstack_project/files/nodepool/scripts/cache_git_repos.py b/modules/openstack_project/files/nodepool/scripts/cache_git_repos.py index 917e6600d1..f30d94cb35 100755 --- a/modules/openstack_project/files/nodepool/scripts/cache_git_repos.py +++ b/modules/openstack_project/files/nodepool/scripts/cache_git_repos.py @@ -19,6 +19,7 @@ import os.path import re import shutil +import sys import urllib2 from common import run_local @@ -27,9 +28,16 @@ URL = ('https://git.openstack.org/cgit/openstack-infra/config/plain/' 'modules/openstack_project/files/review.projects.yaml') PROJECT_RE = re.compile('^-?\s+project:\s+(.*)$') +# Not using an arg libraries in order to avoid module imports that +# are not available across all python versions +if len(sys.argv) > 1: + GIT_BASE = sys.argv[1] +else: + GIT_BASE = 'git://git.openstack.org' + def clone_repo(project): - remote = 'git://git.openstack.org/%s.git' % project + remote = '%s/%s.git' % (GIT_BASE, project) # Clear out any existing target directory first, in case of a retry. try: diff --git a/modules/openstack_project/files/nodepool/scripts/prepare_node.sh b/modules/openstack_project/files/nodepool/scripts/prepare_node.sh index 3846dc9df8..3bbf56b98b 100755 --- a/modules/openstack_project/files/nodepool/scripts/prepare_node.sh +++ b/modules/openstack_project/files/nodepool/scripts/prepare_node.sh @@ -22,6 +22,7 @@ THIN=$3 PYTHON3=${4:-false} PYPY=${5:-false} ALL_MYSQL_PRIVS=${6:-false} +GIT_BASE=${7:-git://git.openstack.org} # Save the nameservers configured by our provider. cat >/tmp/forwarding.conf <