Browse Source

fix: [gogocarto] remove useless computations

It seems ``DBNAME`` is not used in the code, despite being computed.

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
cups_service_alpha
Valentin Lab 2 years ago
parent
commit
6d086aa80e
  1. 25
      gogocarto/hooks/post_deploy

25
gogocarto/hooks/post_deploy

@ -11,31 +11,6 @@ admin_password=$(options-get admin-password 2>/dev/null) || exit 0
admin_email=$(options-get admin-email 2>/dev/null ) || true admin_email=$(options-get admin-email 2>/dev/null ) || true
## XXXvlab: can't get real config here
if ! read-0 ts _ _ < <(get_service_relation "$SERVICE_NAME" "mongo-database"); then
err "Couldn't find relation ${DARKCYAN}mongo-database${NORMAL}."
exit 1
fi
##
## We need mongo relation config also
##
relation_file=$(get_relation_data_file "$SERVICE_NAME" "$ts" "mongo-database") || {
err "Failed to find relation file"
exit 1
}
mongo_config=$(cat "$relation_file") || exit 2
DBNAME="$(e "$mongo_config" | shyaml get-value dbname)" || {
err "Couldn't retrieve information of ${DARKCYAN}mongo-database${NORMAL}'s relation."
exit 1
}
CONTROL="$SERVICE_DATASTORE/.control" CONTROL="$SERVICE_DATASTORE/.control"
## Was it already properly propagated to database ? ## Was it already properly propagated to database ?
control=$(H "${admin_password}" "${admin_email}") control=$(H "${admin_password}" "${admin_email}")

Loading…
Cancel
Save