From 1efc56bfb7b906f4ebcbc607b7fd2e07ae7abdff Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Fri, 21 Apr 2017 12:57:29 +0800 Subject: [PATCH] Using bulk operation to invoke makedhcp to imporve nodeset perforamnce (#2897) --- xCAT-server/lib/xcat/plugins/petitboot.pm | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/petitboot.pm b/xCAT-server/lib/xcat/plugins/petitboot.pm index d40e60694..f99b41c92 100644 --- a/xCAT-server/lib/xcat/plugins/petitboot.pm +++ b/xCAT-server/lib/xcat/plugins/petitboot.pm @@ -545,21 +545,14 @@ sub process_request { if ($t_entry =~ /0|n|N/) { $do_dhcpsetup = 0; } } if ($do_dhcpsetup) { - foreach my $node (@normalnodeset) { - if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command - xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: issue makedhcp request"); - $sub_req->({ command => ['makedhcp'], - node => [$node], - arg => ['-l'] }, $callback); - - #arg=>['-l','-s','option conf-file \"'.$fpath.'\";']},$callback); - } else { - xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: issue makedhcp request"); - $sub_req->({ command => ['makedhcp'], - node => [$node] }, $callback); - - #arg=>['-s','option conf-file \"'.$fpath.'\";']},$callback); - } + if ($::request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command + xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: issue makedhcp request"); + $sub_req->({ command => ['makedhcp'], arg => ['-l'], + node => \@normalnodeset }, $callback); + } else { + xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: issue makedhcp request"); + $sub_req->({ command => ['makedhcp'], + node => \@normalnodeset }, $callback); } } }