From 8db89c11e3d85f50a02558aed01ca0673dcdcb16 Mon Sep 17 00:00:00 2001 From: Benjamin Demarteau Date: Wed, 22 Mar 2023 10:04:34 +0100 Subject: [PATCH] [FIX] Odoo 14.0-16.0: don't pass parameters from the config to the command line Odoo will already use those values, passing them through the command line is not necessary Fixes #334 --- 14.0/entrypoint.sh | 14 +++++++++----- 15.0/entrypoint.sh | 14 +++++++++----- 16.0/entrypoint.sh | 14 +++++++++----- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/14.0/entrypoint.sh b/14.0/entrypoint.sh index f802bcb..3fe52bc 100755 --- a/14.0/entrypoint.sh +++ b/14.0/entrypoint.sh @@ -14,11 +14,15 @@ fi : ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}} DB_ARGS=() +ODOO_ARGS=() function check_config() { param="$1" value="$2" - if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then + if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g') + else + ODOO_ARGS+=("--${param}") + ODOO_ARGS+=("${value}") fi; DB_ARGS+=("--${param}") DB_ARGS+=("${value}") @@ -34,13 +38,13 @@ case "$1" in if [[ "$1" == "scaffold" ]] ; then exec odoo "$@" else - wait-for-psql.py ${DB_ARGS[@]} --timeout=30 - exec odoo "$@" "${DB_ARGS[@]}" + wait-for-psql.py "${DB_ARGS[@]}" --timeout=30 + exec odoo "$@" "${ODOO_ARGS[@]}" fi ;; -*) - wait-for-psql.py ${DB_ARGS[@]} --timeout=30 - exec odoo "$@" "${DB_ARGS[@]}" + wait-for-psql.py "${DB_ARGS[@]}" --timeout=30 + exec odoo "$@" "${ODOO_ARGS[@]}" ;; *) exec "$@" diff --git a/15.0/entrypoint.sh b/15.0/entrypoint.sh index f802bcb..3fe52bc 100755 --- a/15.0/entrypoint.sh +++ b/15.0/entrypoint.sh @@ -14,11 +14,15 @@ fi : ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}} DB_ARGS=() +ODOO_ARGS=() function check_config() { param="$1" value="$2" - if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then + if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g') + else + ODOO_ARGS+=("--${param}") + ODOO_ARGS+=("${value}") fi; DB_ARGS+=("--${param}") DB_ARGS+=("${value}") @@ -34,13 +38,13 @@ case "$1" in if [[ "$1" == "scaffold" ]] ; then exec odoo "$@" else - wait-for-psql.py ${DB_ARGS[@]} --timeout=30 - exec odoo "$@" "${DB_ARGS[@]}" + wait-for-psql.py "${DB_ARGS[@]}" --timeout=30 + exec odoo "$@" "${ODOO_ARGS[@]}" fi ;; -*) - wait-for-psql.py ${DB_ARGS[@]} --timeout=30 - exec odoo "$@" "${DB_ARGS[@]}" + wait-for-psql.py "${DB_ARGS[@]}" --timeout=30 + exec odoo "$@" "${ODOO_ARGS[@]}" ;; *) exec "$@" diff --git a/16.0/entrypoint.sh b/16.0/entrypoint.sh index f802bcb..3fe52bc 100755 --- a/16.0/entrypoint.sh +++ b/16.0/entrypoint.sh @@ -14,11 +14,15 @@ fi : ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}} DB_ARGS=() +ODOO_ARGS=() function check_config() { param="$1" value="$2" - if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then + if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g') + else + ODOO_ARGS+=("--${param}") + ODOO_ARGS+=("${value}") fi; DB_ARGS+=("--${param}") DB_ARGS+=("${value}") @@ -34,13 +38,13 @@ case "$1" in if [[ "$1" == "scaffold" ]] ; then exec odoo "$@" else - wait-for-psql.py ${DB_ARGS[@]} --timeout=30 - exec odoo "$@" "${DB_ARGS[@]}" + wait-for-psql.py "${DB_ARGS[@]}" --timeout=30 + exec odoo "$@" "${ODOO_ARGS[@]}" fi ;; -*) - wait-for-psql.py ${DB_ARGS[@]} --timeout=30 - exec odoo "$@" "${DB_ARGS[@]}" + wait-for-psql.py "${DB_ARGS[@]}" --timeout=30 + exec odoo "$@" "${ODOO_ARGS[@]}" ;; *) exec "$@"