From 8fa83d75716b9650a712c69c356f8cf2726662e7 Mon Sep 17 00:00:00 2001 From: yinle Date: Tue, 18 Jan 2011 06:11:32 +0000 Subject: [PATCH] FSP/BPA redundancy: parse input nodes, change CEC/Frame nodes into FSP/BPA nodes git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8688 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/dhcp.pm | 33 +++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 743bb1273..9f9fffd1f 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -972,6 +972,32 @@ sub process_request } } } + #need to transfer CEC/Frame to FSPs/BPAs + my @inodes = (); + my @validnodes = (); + my $pnode; + my $cnode; + if ($req->{node}) + { + #@inodes = split /,/,${$req->{noderange}}; + foreach $pnode(@{$req->{node}}) + { + my $ntype = xCAT::DBobjUtils->getnodetype($pnode); + if ($ntype =~ /^(cec|frame)$/) + { + $cnode = xCAT::DBobjUtils->getchildren($pnode); + foreach (@$cnode) + { + push @validnodes, $_; + } + } else + { + push @validnodes, $pnode; + } + } + $req->{node} = \@validnodes; + } + if ((!$req->{node}) && (grep /^-a$/, @{$req->{arg}})) { if (grep /-d$/, @{$req->{arg}}) #delete all entries @@ -981,7 +1007,12 @@ sub process_request my @entries = ($nodelist->getAllNodeAttribs([qw(node)])); foreach (@entries) { - push @{$req->{node}}, $_->{node}; + #delete the CEC and Frame node + my $ntype = xCAT::DBobjUtils->getnodetype($_->{node}); + unless ($ntype =~ /^(cec|frame)$/) + { + push @{$req->{node}}, $_->{node}; + } } } else #add all entries