2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-01 00:57:37 +00:00

Only update switch/port information for mtms based discovery

This commit is contained in:
ertaozh
2018-08-30 02:04:57 -04:00
parent 092c045d9a
commit 43a8280eac

View File

@@ -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