From 43a8280eac990814c6aa37762e9e2205073ec64e Mon Sep 17 00:00:00 2001 From: ertaozh Date: Thu, 30 Aug 2018 02:04:57 -0400 Subject: [PATCH] Only update switch/port information for mtms based discovery --- xCAT-server/lib/xcat/plugins/nodediscover.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/nodediscover.pm b/xCAT-server/lib/xcat/plugins/nodediscover.pm index 1ba0b1a16..d7f4fef1e 100644 --- a/xCAT-server/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server/lib/xcat/plugins/nodediscover.pm @@ -414,6 +414,17 @@ sub process_request { # search the management nic and record the switch informaiton foreach my $nic (@{ $request->{nic} }) { if (defined($nic->{'hwaddr'}) && $nic->{'hwaddr'}->[0] =~ /$firstmac/i) { + if (defined($nic->{'switchname'}) && defined($nic->{'switchport'})) { + # update the switch table + my $switchtab = xCAT::Table->new('switch'); + if ($switchtab) { + $switchtab->setNodeAttribs($node, { switch => $nic->{'switchname'}->[0], port => $nic->{'switchport'}->[0] }); + $switchtab->close(); + } + + } + next; + # Don't create switch definition in nodelist, hosts, switches table if (defined($nic->{'switchname'}) && defined($nic->{'switchaddr'})) { # update the switch to switches table