From 1cb8c2bcf4677934059cd561ef48b82da02185b0 Mon Sep 17 00:00:00 2001 From: yatin Date: Mon, 30 Jul 2018 19:59:56 +0530 Subject: [PATCH] [generate_puppetfile] Add support for handling commit We sometimes [1] need to use a commit hash as a pin, so adapt the script to work with commit hash pins as well. [1] https://review.openstack.org/#/c/586946/ Change-Id: I8867b3d41dc6ceef084c6d978cc405b9f6710375 --- playbooks/proposal/generate_puppetfile.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/playbooks/proposal/generate_puppetfile.sh b/playbooks/proposal/generate_puppetfile.sh index af634b93cf..75f3a69b45 100755 --- a/playbooks/proposal/generate_puppetfile.sh +++ b/playbooks/proposal/generate_puppetfile.sh @@ -33,8 +33,12 @@ for e in $(cat external_modules.txt); do if [ ! -z "$pin" ]; then git ls-remote --exit-code https://github.com/$namespace/$module $pin if (($? == 2)); then - echo "Wrong pin: $pin does not exist in $module module." - exit 1 + if ! git ls-remote --exit-code https://github.com/$namespace/$module | grep -q $pin; then + echo "Wrong pin: $pin does not exist in $module module." + exit 1 + else + tag=$pin + fi else tag=$pin fi