Browse Source

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

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

13
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."
exit 1
## 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
}

13
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."
exit 1
## 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