From cc198bef122e7b39ba0cffe0a4862e2e4edb0a21 Mon Sep 17 00:00:00 2001 From: Matt Ezell Date: Mon, 15 May 2017 15:26:58 -0400 Subject: [PATCH] Enable switches to run findme for autodiscovery (#2662) --- xCAT-server/lib/xcat/plugins/switch.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/switch.pm b/xCAT-server/lib/xcat/plugins/switch.pm index ba3d1281f..61dbce696 100644 --- a/xCAT-server/lib/xcat/plugins/switch.pm +++ b/xCAT-server/lib/xcat/plugins/switch.pm @@ -293,15 +293,19 @@ sub process_request { #discovery working. Food for thought. return; } + my $discoverswitch = 0; + if (defined $req->{nodetype} and $req->{nodetype}->[0] eq 'switch') { + $discoverswitch = 1; + } my $firstpass = 1; if ($mac) { - $node = $macmap->find_mac($mac, $req->{cacheonly}->[0]); + $node = $macmap->find_mac($mac, $req->{cacheonly}->[0], $discoverswitch); $firstpass = 0; } if (not $node) { # and $req->{checkallmacs}->[0]) { foreach (@{ $req->{mac} }) { /.*\|.*\|([\dABCDEFabcdef:]+)(\||$)/; - $node = $macmap->find_mac($1, $firstpass); + $node = $macmap->find_mac($1, $firstpass, $discoverswitch); $firstpass = 0; if ($node) { last; } }