mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-03 21:02:34 +00:00 
			
		
		
		
	Merge pull request #875 from xuweibj/S55691
Make genesis to include bmc ip in the findme package
This commit is contained in:
		@@ -132,6 +132,15 @@ fi
 | 
			
		||||
if [ "$PLATFORM" != "unknown" ]; then
 | 
			
		||||
        echo "<platform>$PLATFORM</platform>" >> /tmp/discopacket
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
IsStatic=`ipmitool lan print 1 | grep 'IP Address Source' | grep 'Static'`
 | 
			
		||||
if [ "$IsStatic" ]; then
 | 
			
		||||
    BMCIPADDR=`ipmitool lan print 1 | grep 'IP Address' | grep -v 'IP Address Source' | cut -d ":" -f2 | sed 's/ //'`
 | 
			
		||||
    if [ "$BMCIPADDR" ]; then
 | 
			
		||||
        echo "<bmc>$BMCIPADDR</bmc>" >> /tmp/discopacket
 | 
			
		||||
    fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
#so we have some cases where DMI table explictly records every function number, and some where only first function is enumerated
 | 
			
		||||
#so for each onboard device, we record it.  If it is also the first function, we'll seek out other function numbers and append
 | 
			
		||||
#if that other function number does not show up in its own dmi type 41 record
 | 
			
		||||
 
 | 
			
		||||
@@ -154,6 +154,19 @@ sub process_request {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    # if there is no bmc ip in ipmi table, save bmc ip into ipmi table
 | 
			
		||||
    if (defined($request->{bmc}) && $request->{bmc}->[0]) {
 | 
			
		||||
        my $ipmitab = xCAT::Table->new("ipmi", -create=>1);
 | 
			
		||||
        if ($ipmitab) {
 | 
			
		||||
            my $ipmient = $ipmitab->getNodeAttribs($node,['bmc']);
 | 
			
		||||
            unless ($ipmient->{'bmc'}) {
 | 
			
		||||
                $ipmitab->setNodeAttribs($node, {bmc=>$request->{bmc}->[0]});
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
                $callback->({error=> ["Open ipmi table failed."], errorcode=>["1"]});
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    # save inventory info into the hwinv table
 | 
			
		||||
    if (defined($request->{cpucount}) or defined($request->{cputype}) or defined($request->{memory}) or defined($request->{disksize})) {
 | 
			
		||||
	my $basicdata;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user