2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 03:32:04 +00:00

Merge pull request #7398 from stanford-rc/mtm_empty_fru

Fix MTM detection for incomplete FRU pages
This commit is contained in:
Obihörnchen 2024-02-19 19:13:16 +01:00 committed by GitHub
commit 86c8b3310d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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~/\s+/||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)"
@ -267,7 +267,7 @@ for dev in `ip link|grep -B1 ether|grep UP|awk '{print $2}'|sed -e s/://|grep -v
if [[ ! -z "$myport" && ! "$myport" =~ "Agent instance for device not found" ]]; then
echo " <switchport>$myport</switchport>" >> /tmp/discopacket
fi
echo "</nic>" >> /tmp/discopacket
done
if [ "$UUID" == "unknown" ]; then