From b0009e442708f7b397d8dc1273eff22a1e7b803b Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Mon, 18 Apr 2011 07:13:12 +0000 Subject: [PATCH] fixed bug: 3170686, nodeset modify config file dhcpd.lease git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9334 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/dhcp.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 371685c29..775ab9d0e 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -589,14 +589,14 @@ sub preprocess_request } if(grep /-h/,@{$req->{arg}}) { - my $usage="Usage: makedhcp -n\n\tmakedhcp -a\n\tmakedhcp -a -d\n\tmakedhcp -d noderange\n\tmakedhcp [-s statements] [--HFI]\n\tmakedhcp [-h|--help]"; + my $usage="Usage: makedhcp -n\n\tmakedhcp -a\n\tmakedhcp -a -d\n\tmakedhcp -d noderange\n\tmakedhcp [-s statements]\n\tmakedhcp [-h|--help]"; $callback->({data => [$usage]}); return; } unless (($req->{arg} and (@{$req->{arg}}>0)) or $req->{node}) { - my $usage="Usage: makedhcp -n\n\tmakedhcp -a\n\tmakedhcp -a -d\n\tmakedhcp -d noderange\n\tmakedhcp [-s statements] [--HFI]\n\tmakedhcp [-h|--help]"; + my $usage="Usage: makedhcp -n\n\tmakedhcp -a\n\tmakedhcp -a -d\n\tmakedhcp -d noderange\n\tmakedhcp [-s statements]\n\tmakedhcp [-h|--help]"; $callback->({data => [$usage]}); return; } @@ -1182,9 +1182,10 @@ sub process_request } my $mac = $ent->{mac}; # Workarounds for HFI devices, omshell doesn't support HFI device type, we cannot set hfi as hardware type in dhcp lease-file. - # Replace the ethernet with hfi in lease-file if --HFI is specified. + # Replace the ethernet with hfi in lease-file. # After omshell supports HFI devices, remove these code and add correct hardware type from omshell - if ( grep /^--HFI$/, @{$req->{arg}} ) + my %client_nethash = xCAT::DBobjUtils->getNetwkInfo( [$node] ); + if ( grep /hf/, $client_nethash{$node}{mgtifname} ) { unless ( open( HOSTS,"