From 4e6c268f6f64c1d91d6f0ea23cf72f8d87675990 Mon Sep 17 00:00:00 2001 From: Ramy Asselin Date: Thu, 29 May 2014 10:38:02 -0700 Subject: [PATCH] Allow choice of GIT protocol used. From within some corporate http networks, the 'git' protocol cannot be used. Update the prepare_node and cache_git_repos scripts to default to using the 'git' protocol, but allow customiztion to use the 'http' protocol via command line argument. In addition, allow the full base url to be modifed as done in devstack stackrc to also allow changing repositories. Change-Id: I875f2e46c466e4e0fb7a5d4dbc54e958d91f9151 Partial-Bug: #1307702 --- .../files/nodepool/scripts/cache_git_repos.py | 10 +++++++++- .../files/nodepool/scripts/prepare_node.sh | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-) 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 2f9cab4e4a..8458c7f3a4 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 <