diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 5affd8a3c..46bb6b7c3 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -1604,10 +1604,15 @@ sub process_request my $generatedpath = "$syspath/$dhcpver"; my $dhcpd_key = "DHCPDARGS"; - if ($os =~ /sles/i) { + # For SLES11+ and RHEL7+ Operating system releases, the + # dhcpd/dhcpd6 configuration is stored in the same file + my $os_ver = $os; + $os_ver =~ s/[^0-9.^0-9]//g; + if (($os =~ /sles/i && $os_ver >= 11) || + ($os =~ /rhels/i && $os_ver >= 7)) { + $dhcpd_key = "DHCPD_INTERFACE"; if ($usingipv6 and $dhcpver eq "dhcpd6") { - # For SLES, the dhcpd6 "dhcpver" is going to modify the dhcpd conf file with key=DHCPD6_INTERFACE $dhcpd_key = "DHCPD6_INTERFACE"; $generatedpath = "$syspath/dhcpd"; } @@ -1667,8 +1672,8 @@ sub process_request } if ($usingipv6) { - # sles had dhcpd and dhcpd6 config in the dhcp file - if ($os =~ /sles/i) { + # sles11.3 and rhels7 has dhcpd and dhcpd6 config in the dhcp file + if ($os =~ /sles/i || $os =~ /rhels7/i) { if ($missingfiles{dhcpd}) { $callback->({error=>["The file /etc/sysconfig/dhcpd doesn't exist, check the dhcp server"]}); }