Repair error reporting after Ubuntu change
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10453 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
7e2f7fdea5
commit
3027db57c3
@ -1021,8 +1021,15 @@ sub process_request
|
||||
{
|
||||
#add the active nics to /etc/sysconfig/dhcpd or /etc/default/dhcp3-server(ubuntu)
|
||||
my $dhcpver;
|
||||
my %missingfiles = ( "dhcpd"=>1, "dhcpd6"=>1, "dhcp3-server"=>1 );
|
||||
foreach $dhcpver ("dhcpd","dhcpd6","dhcp3-server") {
|
||||
if (-e "/etc/sysconfig/$dhcpver") {
|
||||
if ($dhcpver eq "dhcpd") {
|
||||
delete($missingfiles{dhcpd});
|
||||
delete($missingfiles{dhcp3-server});
|
||||
} else {
|
||||
delete($missingfiles{$dhcpver});
|
||||
}
|
||||
open DHCPD_FD, "/etc/sysconfig/$dhcpver";
|
||||
my $syscfg_dhcpd = "";
|
||||
my $found = 0;
|
||||
@ -1058,6 +1065,8 @@ sub process_request
|
||||
print DBG_FD $syscfg_dhcpd;
|
||||
close DBG_FD;
|
||||
}elsif (-e "/etc/default/$dhcpver") { #ubuntu
|
||||
delete($missingfiles{dhcpd});
|
||||
delete($missingfiles{dhcp3-server});
|
||||
open DHCPD_FD, "/etc/default/$dhcpver";
|
||||
my $syscfg_dhcpd = "";
|
||||
my $found = 0;
|
||||
@ -1090,11 +1099,15 @@ sub process_request
|
||||
print DBG_FD $syscfg_dhcpd;
|
||||
close DBG_FD;
|
||||
|
||||
} elsif ($_ eq "dhcpd" or $usingipv6) {
|
||||
$callback->({error=>"The file /etc/sysconfig/$_ doesn't exist, check the dhcp server"});
|
||||
# return;
|
||||
}
|
||||
}
|
||||
if ($usingipv6 and $missingfiles{dhcpd6}) {
|
||||
$callback->({error=>"The file /etc/sysconfig/dhcpd6 doesn't exist, check the dhcp server"});
|
||||
}
|
||||
if ($missingfiles{dhcpd}) {
|
||||
$callback->({error=>"The file /etc/sysconfig/dhcpd doesn't exist, check the dhcp server"});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
unless ($dhcpconf[0])
|
||||
|
Loading…
Reference in New Issue
Block a user