From 7e4f11119d3c2d1748fcf55b7e3969adb874ab0e Mon Sep 17 00:00:00 2001 From: Kilian Cavalotti Date: Thu, 27 Jul 2023 14:07:40 -0700 Subject: [PATCH] fix FRU parsing when empty values are provided --- xCAT-genesis-scripts/usr/bin/dodiscovery | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-genesis-scripts/usr/bin/dodiscovery b/xCAT-genesis-scripts/usr/bin/dodiscovery index 79ac717f7..0afb4f1b1 100755 --- a/xCAT-genesis-scripts/usr/bin/dodiscovery +++ b/xCAT-genesis-scripts/usr/bin/dodiscovery @@ -94,7 +94,7 @@ if [ -r /sys/devices/virtual/dmi/id/product_name ]; then #x86 if [ -z "$MTM" ]; then FRU=`ipmitool fru print 0` if [ $? -eq 0 ]; then - MTM=`echo "$FRU" | awk -F': ' '/Product Manufacturer/ {m=$2} /Product Name|Product Part Number/ {if (n==""||n=="NONE") {n=$2}} END {print m":"n}'` + MTM=`echo "$FRU" | awk -F': ' '/Product Manufacturer/ {m=$2} /Product Name|Product Part Number/ {if (n==""||n~/ +/||n=="NONE") {n=$2}} END {print m":"n}'` fi if [ -z "$MTM" -o "$MTM" == ":" ]; then logger -s -t $log_label -p local4.warning "Couldn't find MTM information in FRU, falling back to DMI (MTMS-based discovery may fail)"