From aa93414e69e98c01b8c4f82b003bdc1e4f404084 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 17 Oct 2019 15:08:09 -0400 Subject: [PATCH] bmcdiscover node name when serial or mtm and mac not available --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index a16765531..8c979363b 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1160,8 +1160,10 @@ sub bmcdiscovery_ipmi { $mtm = '' if ($mtm =~ /^0+$/); $serial = '' if ($serial =~ /^0+$/); - unless (($mtm or $serial) or $ipmac{$ip}) { - xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and/or Serial and MAC Address is unavailable for $ip"] }, $::CALLBACK); + # To constract a node name need either mac or both mtm and serial + # Exit if mac AND one of mtm or serial is missing + if (!($mtm and $serial) and !$ipmac{$ip}) { + xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and Serial or MAC Address is unavailable for $ip"] }, $::CALLBACK); return; } @@ -1292,8 +1294,10 @@ sub bmcdiscovery_openbmc{ $mtm = '' if ($mtm =~ /^0+$/); $serial = '' if ($serial =~ /^0+$/); - unless (($mtm or $serial) or $ipmac{$ip}) { - xCAT::MsgUtils->message("W", { data => ["Could not obtain Valid Model Type and/or Serial Number and MAC Address for BMC at $ip"] }, $::CALLBACK); + # To constract a node name need either mac or both mtm and serial + # Exit if mac AND one of mtm or serial is missing + if (!($mtm and $serial) and !$ipmac{$ip}) { + xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and Serial or MAC Address is unavailable for $ip"] }, $::CALLBACK); return; }