From a762b0d3a1f1a45cacaa075bbd171598e492d0c3 Mon Sep 17 00:00:00 2001 From: Ernst Hellbar Date: Fri, 11 Jul 2025 10:35:00 +0200 Subject: [PATCH] gen_topo scripts: on error, print the last stderr message first --- DATA/tools/epn/gen_topo.sh | 1 - DATA/tools/epn/gen_topo_logged.sh | 2 ++ DATA/tools/epn/gen_topo_o2dpg.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DATA/tools/epn/gen_topo.sh b/DATA/tools/epn/gen_topo.sh index 6c63bd4f8..79c4a5db4 100755 --- a/DATA/tools/epn/gen_topo.sh +++ b/DATA/tools/epn/gen_topo.sh @@ -61,6 +61,5 @@ fi # Run stage 2 of GenTopo, which does the PDP part, still from hardcoded updatable RPM path /opt/alisw/el9/GenTopo/bin/gen_topo_o2dpg.sh if [ $? != 0 ]; then - echo topology generation failed 1>&2 exit 1 fi diff --git a/DATA/tools/epn/gen_topo_logged.sh b/DATA/tools/epn/gen_topo_logged.sh index c15d5f711..7d2afbb37 100755 --- a/DATA/tools/epn/gen_topo_logged.sh +++ b/DATA/tools/epn/gen_topo_logged.sh @@ -26,6 +26,8 @@ if [[ ! -z $GEN_TOPO_LOGDATE ]]; then while read STDERRLINE; do echo "$GEN_TOPO_LOGDATE $ECS_ENVIRONMENT_ID : $STDERRLINE" >> /var/log/topology/gen-topo.log done < $STDERRFILE + echo "FATAL $(tail -n 1 $STDERRFILE)" 1>&2 + echo -e "\n - full stderr output:" 1>&2 fi fi diff --git a/DATA/tools/epn/gen_topo_o2dpg.sh b/DATA/tools/epn/gen_topo_o2dpg.sh index 39bdfc98a..22f77cba8 100755 --- a/DATA/tools/epn/gen_topo_o2dpg.sh +++ b/DATA/tools/epn/gen_topo_o2dpg.sh @@ -134,7 +134,7 @@ if [[ ! -z "$GEN_TOPO_ODC_EPN_TOPO_POST_CACHING_CMD" ]] && [[ "0$WORKFLOWMODE" ! fi TMP_POST_CACHING_CMD+=" -o $GEN_TOPO_WORKDIR/output.xml.new $GEN_TOPO_WORKDIR/output.xml" echo "Running post-caching topo-merger command: $TMP_POST_CACHING_CMD" 1>&2 - eval $TMP_POST_CACHING_CMD 1>&2 || { echo Error during EPN topology-merger resource allocation 1>&2; exit 1; } + eval $TMP_POST_CACHING_CMD 1>&2 || { echo Error during EPN resource allocation 1>&2; exit 1; } mv -f $GEN_TOPO_WORKDIR/output.xml.new $GEN_TOPO_WORKDIR/output.xml 1>&2 fi