2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-24 04:00:26 +00:00

Merge pull request #5568 from zet809/no_create_switch_object_for_mtms

Only update switch/port information for mtms based discovery
This commit is contained in:
cxhong
2018-08-31 09:57:08 -04:00
committed by GitHub

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