aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authoryuqian <yu.qian@99cloud.net>2018-06-23 13:47:56 +0800
committeryuqian <yu.qian@99cloud.net>2018-07-02 14:08:54 +0800
commit8f156691ce1da72218c666c32f01607d8a55b07b (patch)
tree73d5ecdb650bcad223bb40908316d7a3b58b9630 /tools
parent13cf0e05bdca8c569a4bf3b0206ac68266e85ed2 (diff)
downloadkolla-ansible-8f156691ce1da72218c666c32f01607d8a55b07b.tar.gz
kolla-ansible-8f156691ce1da72218c666c32f01607d8a55b07b.zip
fixed destroy confirmation no properly evaluated
To destroy a kolla-ansible environment a confirmation string should be passed along with kolla-ansible command: kolla-ansible destroy -i ~/multinode \ --yes-i-really-really-mean-it However, this string is not evaluated right and just putting --y starts destroy process: ./kolla-ansible destroy -i ~/multinode --y Change-Id: I5983f9c7fd3859d60741dfd23ad10dfd91872eeb Closes-Bug: #1701313
Diffstat (limited to 'tools')
-rwxr-xr-xtools/kolla-ansible7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/kolla-ansible b/tools/kolla-ansible
index 28435f6b5..eb29e7b3e 100755
--- a/tools/kolla-ansible
+++ b/tools/kolla-ansible
@@ -106,6 +106,8 @@ EOF
SHORT_OPTS="hi:p:t:k:e:v"
LONG_OPTS="help,inventory:,playbook:,skip-tags:,tags:,key:,extra:,verbose,configdir:,passwords:,limit:,vault-id:,ask-vault-pass,vault-password-file:,yes-i-really-really-mean-it,include-images,include-dev"
+
+RAW_ARGS="$*"
ARGS=$(getopt -o "${SHORT_OPTS}" -l "${LONG_OPTS}" --name "$0" -- "$@") || { usage >&2; exit 2; }
eval set -- "$ARGS"
@@ -159,7 +161,10 @@ while [ "$#" -gt 0 ]; do
;;
(--yes-i-really-really-mean-it)
- DANGER_CONFIRM="$1"
+ if [[ ${RAW_ARGS} =~ "$1" ]]
+ then
+ DANGER_CONFIRM="$1"
+ fi
shift 1
;;