From e7c5f506fea71338c02bfa95e4b0ce2c0882630f Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Tue, 11 Dec 2012 11:09:05 +0000 Subject: [PATCH] add dhcpinterfaces in servicenode table git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14615 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/dhcp.pm | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index ac6093ad4..429ec26bd 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -889,11 +889,23 @@ sub process_request return; } - #my $sitetab = xCAT::Table->new('site'); + my $servicenodetab = xCAT::Table->new('servicenode'); + my @nodeinfo = xCAT::Utils->determinehostname; + my $nodename = pop @nodeinfo; # get hostname + my $dhcpinterfaces = $servicenodetab->getNodeAttribs($nodename, ['dhcpinterfaces']); + my %activenics; my $querynics = 1; - #if ($sitetab) - #{ + + if ( xCAT::Utils->isServiceNode() and $dhcpinterfaces and $dhcpinterfaces->{dhcpinterfaces} ) { + my @dhcpifs = split ',', $dhcpinterfaces->{dhcpinterfaces}; + foreach my $nic ( @dhcpifs ) { + $activenics{$nic} = 1; + $querynics = 0; + } + } + else + { #my $href; #($href) = $sitetab->getAttribs({key => 'dhcpinterfaces'}, 'value'); my @entries = xCAT::TableUtils->get_site_attribute("dhcpinterfaces"); @@ -972,7 +984,7 @@ sub process_request return; } $domain = $t_entry; - #} + } @dhcpconf = (); @dhcp6conf = ();