From 88649d95477f63100ae64ee174347da8a7ddd903 Mon Sep 17 00:00:00 2001 From: Carlos Goncalves Date: Mon, 23 Jul 2018 14:49:56 +0200 Subject: [PATCH] Fix DIB_REPOREF_amphora_agent not set on Git !=1.8.5 Setting DIB_REPOREF_amphora_agent with git -c does not work. The option -c is for passing key-value configurations and git -C option was introduced in git v1.8.5 which some distros do not include (e.g. CentOS 7.5 ships with git v1.8.3.1). As a result, DIB_REPOREF_amphora_agent is not set on any git version !=1.8.5. The alternative that works across all tested Git versions is: git --git-dir=/.git sub-command Change-Id: I41993fa0f8bfde4b7ca9509872de5b54e2ed5680 Story: 2003067 Task: 23114 --- devstack/plugin.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 17501506d2..2706a4d65a 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -56,13 +56,8 @@ function build_octavia_worker_image { export DIB_REPOLOCATION_pip_and_virtualenv=file://$GET_PIP_CACHE_LOCATION fi export DIB_REPOLOCATION_amphora_agent=$OCTAVIA_DIR + export DIB_REPOREF_amphora_agent=$(git --git-dir="$OCTAVIA_DIR/.git" log -1 --pretty="format:%H") - git_minimum_version=$(git --version | awk '{print $NF "\n1.8.5" }' | sort -V | head -1) - if [[ ${git_minimum_version} == "1.8.5" ]]; then - export DIB_REPOREF_amphora_agent=$(git -C "$OCTAVIA_DIR" log -1 --pretty="format:%H") - else - export DIB_REPOREF_amphora_agent=$(git -c "$OCTAVIA_DIR" log -1 --pretty="format:%H") - fi TOKEN=$(openstack token issue -f value -c id) die_if_not_set $LINENO TOKEN "Keystone failed to get token."