Reduce unnecessary API calls

The role will no longer make API calls to authorize already authorized members to a network.
This commit is contained in:
Marcus Meurs
2018-12-04 01:06:35 +01:00
parent c03c2b5a3f
commit 672c67e087
2 changed files with 9 additions and 8 deletions

View File

@@ -8,18 +8,17 @@ function file_content {
if [ ! -z "$NETWORKS" ]; then
echo "{"
echo " \"node_id\":\"${NODE_STATUS[2]}\","
echo " \"networks\": ["
echo " \"networks\": {"
while read -r; do
network=($REPLY)
echo " {"
echo " \"id\":\"${network[2]}\","
echo " \"status\":\"${network[5]}\""
echo " }"
echo " \"${network[2]}\": {"
echo " \"status\":\"${network[5]}\""
echo " }"
done <<< $NETWORKS
echo " ]"
echo " }"
echo "}"
else
echo "{\"node_id\":\"${NODE_STATUS[2]}\"}"
echo "{\"node_id\":\"${NODE_STATUS[2]}\",\"networks\":{}}"
fi
}