From cc16eed64fd22bb46203543c9a1ac97c13dc0c77 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 21 Jul 2022 14:04:23 +0200 Subject: [PATCH] TT#177550 check: Add code to check the multi-site setup This off-loads the check to the ngcp-site script, and prints any error message from it if the script fails. Only run the check if ngcp-site is present, so that we avoid a hard-dependency on system-tools. Change-Id: I640f85383d424980d81a207dee7d586a88422862 (cherry picked from commit ac1744b253c2929d31856f0b3c946952f0af0417) --- scripts/check | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/check b/scripts/check index 3a375c3e..56a842b4 100755 --- a/scripts/check +++ b/scripts/check @@ -90,6 +90,20 @@ check_origin() { fi } +check_multi_site() { + log_debug "Checking multi-site support" + if ! command -v ngcp-site >/dev/null; then + log_debug "Skipping check due to missing ngcp-site" + return 0 + fi + + if ! error=$(ngcp-site 2>&1 >/dev/null); then + log_error "Configuration problem with multi-site setup." + log_error "${error}" + exit 1 + fi +} + check_config_encoding() { log_debug "Checking encoding for $config_files" for f in $config_files ; do @@ -245,6 +259,8 @@ check_branch check_origin +check_multi_site + check_configs if "${VALIDATE_SCHEMA:-false}" || [ "${VALIDATE:-0}" = "1" ] ; then validate_config