Browse Source

new: [odoo-tecnativa] fetch admin password in config if not specified.

Signed-off-by: Valentin Lab <valentin.lab@kalysto.org>
dev
Valentin Lab 5 years ago
parent
commit
541dde1f25
  1. 11
      odoo-tecnativa/actions/load
  2. 11
      odoo-tecnativa/actions/save

11
odoo-tecnativa/actions/load

@ -67,9 +67,16 @@ set -e
## Ensure odoo is launched
service_def=$(get_compose_service_def "$SERVICE_NAME")
ADMIN_PASSWORD=$(echo "$service_def" | shyaml get-value options.admin-password) || {
err "Could not find 'admin-password' in $SERVICE_NAME service definition."
## XXXvlab: should be moved to lib
CONFIG=$SERVICE_CONFIGSTORE/etc/odoo-server.conf
ADMIN_PASSWORD=$(echo "$service_def" | shyaml -q get-value options.admin-password) || {
if [ -e "$CONFIG" ]; then
ADMIN_PASSWORD=$(grep ^admin_passwd "$CONFIG" | sed -r 's/^admin_passwd\s+=\s+(.+)$/\1/g')
fi
if [ -z "$ADMIN_PASSWORD" ]; then
err "Could not find 'admin-password' in $SERVICE_NAME service definition nor in config file."
exit 1
fi
}

11
odoo-tecnativa/actions/save

@ -70,9 +70,16 @@ set -e
## Ensure odoo is launched
service_def=$(get_compose_service_def "$SERVICE_NAME")
ADMIN_PASSWORD=$(echo "$service_def" | shyaml get-value options.admin-password) || {
err "Could not find 'admin-password' in $SERVICE_NAME service definition."
## XXXvlab: should be moved to lib
CONFIG=$SERVICE_CONFIGSTORE/etc/odoo-server.conf
ADMIN_PASSWORD=$(echo "$service_def" | shyaml -q get-value options.admin-password) || {
if [ -e "$CONFIG" ]; then
ADMIN_PASSWORD=$(grep ^admin_passwd "$CONFIG" | sed -r 's/^admin_passwd\s+=\s+(.+)$/\1/g')
fi
if [ -z "$ADMIN_PASSWORD" ]; then
err "Could not find 'admin-password' in $SERVICE_NAME service definition nor in config file."
exit 1
fi
}

Loading…
Cancel
Save