scripts: Fix getting external role SHA when working on master

When force_master == true, the code did not try to get tag information
from external roles but it tried to get the SHA for the specified
$osa_branch. External roles do not have stable/* branches, so the result
was an empty version. We fix that by simply falling back to master
branch if 'force_master' is set to True.

Depends-On: https://review.openstack.org/#/c/598246/
Change-Id: I73b8591217298511132d67f7a83ef27b093c02e4
This commit is contained in:
Markos Chandras 2018-08-30 15:51:05 +01:00
parent 1297b96a63
commit 69cf1a56e9

View File

@ -256,6 +256,12 @@ update_ansible_role_requirements() {
role_version=$(git ls-remote ${role_src} | grep "${osa_branch}$" | awk '{print $1}')
fi
# If we are forcing master and we still don't have a role_version defined, then we need
# to fallback to master branch
if [[ -z "${role_version}" ]] && [[ "${force_master}" == "true" ]]; then
role_version=$(git ls-remote ${role_src} | grep master | awk '{print $1}')
fi
# For OSA roles, get the release notes
if [[ ${role_src} == *"git.openstack.org"* ]]; then
local osa_repo_tmp_path="/tmp/osa_${role_name}"