mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-04 05:12:30 +00:00 
			
		
		
		
	Only update switch/port information for mtms based discovery
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user