commit a10158042f676dc12fd4f401377f0636c0ff7938
parent 384235378553d21a05170a282df6abc0f3bdcbac
Author: Antoine A <>
Date: Wed, 19 Feb 2025 16:11:16 +0100
regional: catch config.py error
Diffstat:
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/regional-currency/config.py b/regional-currency/config.py
@@ -155,7 +155,8 @@ def ask(
if secret:
raw = getpass.getpass(msg).strip()
else:
- raw = input(msg).strip()
+ print(msg, end='')
+ raw = input().strip()
if raw == "":
if default is None:
print("You must enter a value")
diff --git a/regional-currency/functions.sh b/regional-currency/functions.sh
@@ -43,4 +43,13 @@ function expect_vars() {
exit 1
fi
done
+}
+
+# Load dynamic and encrypted configuration using a python script
+function load_config() {
+ {
+ trap notify_err ERR
+ CONF=$(./config.py 3>&1 1>&4 2>&5 4>&- 5>&-)
+ eval "$CONF"
+ } 4>&1 5>>setup.log
}
\ No newline at end of file
diff --git a/regional-currency/main.sh b/regional-currency/main.sh
@@ -42,7 +42,7 @@ say "Installing packages (step 1 of 6)"
say ""
say "Interactive configuration (step 2 of 6)"
-{ source <(./config.py 3>&1 >&4 4>&-); } 4>&1
+load_config
# Remove when libeufin currencies.conf is in sync with exchange
cat >>/usr/share/libeufin/config.d/netzbon.conf <<EOF
diff --git a/regional-currency/setup-libeufin.sh b/regional-currency/setup-libeufin.sh
@@ -7,8 +7,8 @@
set -eu
source functions.sh
-{ source <(./config.py 3>&1 >&4 4>&-); } 4>&1
source config/internal.conf
+load_config
say "Beginning LibEuFin setup"