From b4490c0e69ee721f34b2370a9451ef689505d79c Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 18 Feb 2019 15:21:12 +0100 Subject: [conf-tgz] do not emergency_shell if SLX_LOCAL_CONFIGURATION is missing --- builder/modules.d/conf-tgz/hooks/unpack-config-tgz.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/builder/modules.d/conf-tgz/hooks/unpack-config-tgz.sh b/builder/modules.d/conf-tgz/hooks/unpack-config-tgz.sh index 7bae4713..588a65d3 100755 --- a/builder/modules.d/conf-tgz/hooks/unpack-config-tgz.sh +++ b/builder/modules.d/conf-tgz/hooks/unpack-config-tgz.sh @@ -22,7 +22,6 @@ exceptions.catch { logging.error "Failed to extract '/etc/config.tgz' to '$temporary_extract_directory'." logging.error "$exceptions_last_traceback" - emergency_shell "error in ${BASH_SOURCE[0]}" } # extracted to temporary directory, now check for SLX_LOCAL_CONFIGURATION source "/etc/openslx" @@ -31,19 +30,17 @@ if [[ -n "$SLX_LOCAL_CONFIGURATION" ]]; then { exceptions.activate if [[ ! -d "${temporary_extract_directory}/openslx-configs/${SLX_LOCAL_CONFIGURATION}" ]]; then - logging.warn "SLX_LOCAL_CONFIGURATION is set but no corresponding folder found in '/etc/config.tgz'." - emergency_shell "error in ${BASH_SOURCE[0]}" + logging.warn "SLX_LOCAL_CONFIGURATION is set but no corresponding folder found in '/etc/config.tgz'. Ignoring..." + else + cd "${temporary_extract_directory}/openslx-configs/${SLX_LOCAL_CONFIGURATION}" + tar --create --preserve-permissions * | tar --extract --preserve-permissions --directory "${temporary_extract_directory}" fi - # still here? then process to merge the localized configuration files with the common files. - cd "${temporary_extract_directory}/openslx-configs/${SLX_LOCAL_CONFIGURATION}" - tar --create --preserve-permissions * | tar --extract --preserve-permissions --directory "${temporary_extract_directory}" } exceptions.catch { # errors here are not critical, so no emergency shell logging.error "Failed to merge local configuration files for '$SLX_LOCAL_CONFIGURATION'." logging.error "$exceptions_last_traceback" - emergency_shell "error in ${BASH_SOURCE[0]}" } fi # now just copy everything from the temporary_extract_directory to the future root @@ -60,5 +57,4 @@ exceptions.catch # errors here are not critical, so no emergency shell logging.error "Failed to copy extracted configuration files to '$NEWROOT'." logging.error "$exceptions_last_traceback" - emergency_shell "error in ${BASH_SOURCE[0]}" } -- cgit v1.2.3-55-g7522