From a25cfad3353dfe1087492ef8f7b591175a3c706b Mon Sep 17 00:00:00 2001 From: Dave Bouvier Date: Mon, 28 Jul 2014 12:17:47 -0400 Subject: [PATCH] Improve fetching of api key for newly created user. --- .../scripts/bootstrap_tool_shed/bootstrap_tool_shed.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_tool_shed.sh b/lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_tool_shed.sh index 83e48ad01e3..bdb85bb3a83 100755 --- a/lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_tool_shed.sh +++ b/lib/tool_shed/scripts/bootstrap_tool_shed/bootstrap_tool_shed.sh @@ -73,12 +73,11 @@ while : ; do fi done -echo -n "Retrieving admin user's API key..." -api_key_json=`curl -s --user $admin_user_email:$admin_user_password $local_shed_url/api/authenticate/baseauth/` -api_key=`echo $api_key_json | grep api_key | awk 'BEGIN { FS="\"" } ; { print \$4 }' | sed 's/\\s\+//'` +echo -n "Retrieving admin user's API key from $local_shed_url..." +api_key=`curl -s --user $admin_user_email:$admin_user_password $local_shed_url/api/authenticate/baseauth/ | sed 's/.\+api_key[^0-9a-f]\+\([0-9a-f]\+\).\+/\1/'` if [[ -z $api_key && ${api_key+x} ]] ; then - stop_err "Error getting API key for user $admin_user_email." + stop_err "Error getting API key for user $admin_user_email." fi echo " done."