enhanced profilenodes.pm to acquire chain attribute from hardwareprofile and append it to the node

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16707 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
duowang 2013-06-20 03:22:46 +00:00
parent d5e329e4c7
commit 2f669c1ac6

View File

@ -1728,10 +1728,28 @@ sub gen_new_hostinfo_string{
}
}
$hostinfo_dict{$item}{"chain"} = 'osimage='.$provmethod;
# get the chain attribute from hardwareprofile and insert it to node.
my $chaintab = xCAT::Table->new('chain');
my $hardwareprofile = $args_dict{'hardwareprofile'};
my $chain = $chaintab->getNodeAttribs($hardwareprofile, ['chain']);
if (exists $chain->{'chain'}) {
my $hardwareprofile_chain = $chain->{'chain'};
$hostinfo_dict{$item}{"chain"} = $hardwareprofile_chain.',osimage='.$provmethod;
}
else {
$hostinfo_dict{$item}{"chain"} = 'osimage='.$provmethod;
}
if (exists $netprofileattr{"bmc"}){ # Update BMC records.
$hostinfo_dict{$item}{"mgt"} = "ipmi";
$hostinfo_dict{$item}{"chain"} = "runcmd=bmcsetup,osimage=$provmethod:reboot4deploy";
if (index($hostinfo_dict{$item}{"chain"}, "runcmd=bmcsetup") == -1){
$hostinfo_dict{$item}{"chain"} = 'runcmd=bmcsetup,'.$hostinfo_dict{$item}{"chain"}.':reboot4deploy';
}
else{
$hostinfo_dict{$item}{"chain"} = $hostinfo_dict{$item}{"chain"}.':reboot4deploy';
}
if (exists $ipshash{"bmc"}){
$hostinfo_dict{$item}{"bmc"} = $ipshash{"bmc"};