From 1102864c819ba96df69cfb3e1a6142aef0974506 Mon Sep 17 00:00:00 2001 From: Andy Ning Date: Tue, 21 Jul 2020 14:47:48 -0400 Subject: [PATCH] Fix 20-exempt-admin-from-lockout.sh for IPv6 For IPv6 system, the script will fail with return status 1. This is caused by curl fails to parse request url with IPv6 IP address in "[ ]". The error produced by curl will be: curl: (3) [globbing] error: bad range specification after pos 9 The fix is to add a "-g" option to the curl command. Change-Id: I7f2c9c1eca81e845f2d443f3b8962ab206f1328d Closes-Bug: 1887470 Signed-off-by: Andy Ning --- .../upgrade-scripts/20-exempt-admin-from-lockout.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllerconfig/controllerconfig/upgrade-scripts/20-exempt-admin-from-lockout.sh b/controllerconfig/controllerconfig/upgrade-scripts/20-exempt-admin-from-lockout.sh index a6cb873ed7..298c8aef8a 100644 --- a/controllerconfig/controllerconfig/upgrade-scripts/20-exempt-admin-from-lockout.sh +++ b/controllerconfig/controllerconfig/upgrade-scripts/20-exempt-admin-from-lockout.sh @@ -46,7 +46,7 @@ if [ "$TO_RELEASE" == "20.06" ] && [ "$ACTION" == "activate" ]; then req_url="${OS_AUTH_URL}/users/${user_id}" data_json="{\"user\": {\"options\": {\"${option}\": ${option_value}}}}" - ret=$(/usr/bin/curl -X PATCH -H "X-Auth-Token: ${token}" \ + ret=$(/usr/bin/curl -g -X PATCH -H "X-Auth-Token: ${token}" \ -H "Content-Type: application/json" -d "${data_json}" "${req_url}") if [ $? -ne 0 ]; then log "$NAME: Set ${option} option for user ${user_name} failed."