MT#55942 tt2-process: Move YAML config existence check from callers

For multi-site support we need to pass all the possible files to load,
and these might be different between sites, so we need to check for
their existence from within tt2-process, instead of from the outside as
that would restrict them to only the current site.

Change-Id: I0965506832aa2f0a1ba67b19511c509bec60922e
mr11.5
Guillem Jover 2 years ago
parent d28ff985ae
commit cf71caa167

@ -422,6 +422,8 @@ sub merge_yml {
return $config if exists $loaded_ymls{$file};
$loaded_ymls{$file} = undef;
return $config if not -f $file;
my $prefix = output_prefix();
print "$prefix: Loading $file in memory:" unless $options{quiet};
my $hm = Hash::Merge->new('RIGHT_PRECEDENT');

@ -44,9 +44,7 @@ if [ -n "${NGCP_JOBS:-}" ] ; then
fi
for f in ${NGCPCTL_CONFIG:-} ${NODE_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${MAINTENANCE_CONFIG:-} ${NETWORK_CONFIG:-} "${EXTRA_CONFIG_FILES[@]}" ${CONSTANTS_CONFIG:-} ; do
if [ -r "$f" ] ; then
ARGS+=("-c" "$f")
fi
ARGS+=("-c" "$f")
done
build_config_files_instances() {

@ -47,9 +47,7 @@ fi
# Get the list of configs in proper order to load.
declare -a ARGS
for f in ${NGCPCTL_CONFIG:-} ${NODE_CONFIG:-} ${PAIR_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${MAINTENANCE_CONFIG:-} ${NETWORK_CONFIG:-} "${EXTRA_CONFIG_FILES[@]}" ${CONSTANTS_CONFIG:-} ; do
if [ -r "$f" ] ; then
ARGS+=("-c" "${f}")
fi
ARGS+=("-c" "${f}")
done
# main script

Loading…
Cancel
Save