From 01a4a494052c84c346d8203334e73cdffc5668cd Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 21 Sep 2017 22:46:20 -0400 Subject: [PATCH] Delete all '.' in mtm and serial string for OpenBMC --- xCAT-genesis-scripts/bin/dodiscovery | 2 ++ xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-genesis-scripts/bin/dodiscovery b/xCAT-genesis-scripts/bin/dodiscovery index a92c19eb7..29e8ba559 100755 --- a/xCAT-genesis-scripts/bin/dodiscovery +++ b/xCAT-genesis-scripts/bin/dodiscovery @@ -159,10 +159,12 @@ fi flag_mtm=`echo '$MTM' | sed 's/0//g'` if [ $flag_mtm ] && [ "$MTM" != "unknown" ]; then + MTM=`echo $MTM | sed 's/\.//g'` echo "$MTM" >> /tmp/discopacket fi flag_serial=`echo '$SERIAL' | sed 's/0//g'` if [ $flag_serial ] && [ "$SERIAL" != "unknown" ]; then + SERIAL=`echo $SERIAL | sed 's/\.//g'` echo "$SERIAL" >> /tmp/discopacket fi if [ "$PLATFORM" != "unknown" ]; then diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 270ab01a1..4264f519d 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1155,8 +1155,8 @@ sub bmcdiscovery_openbmc{ } # delete space before and after - $mtm =~ s/^\s+|\s+$//g; - $serial =~ s/^\s+|\s+$//g; + $mtm =~ s/^\s+|\s+$|\.+//g; + $serial =~ s/^\s+|\s+$|\.+//g; $mtm = '' if ($mtm =~ /^0+$/); $serial = '' if ($serial =~ /^0+$/);