From 2f669c1ac6076e791be7a9b23191f84a04843d25 Mon Sep 17 00:00:00 2001 From: duowang Date: Thu, 20 Jun 2013 03:22:46 +0000 Subject: [PATCH] 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 --- xCAT-server/lib/xcat/plugins/profilednodes.pm | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/profilednodes.pm b/xCAT-server/lib/xcat/plugins/profilednodes.pm index cac33aea5..563dee885 100644 --- a/xCAT-server/lib/xcat/plugins/profilednodes.pm +++ b/xCAT-server/lib/xcat/plugins/profilednodes.pm @@ -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"};