From da9d6a23ef2486d44e2ef2e9204d89f8c1d70534 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 18 Nov 2015 13:13:06 -0500 Subject: [PATCH] Add code to check the os version by looking for the digit values in the $os string. If >= SLES 11 or >= RHEL 7, dhcpd and dhcpd6 share the same configuration file --- xCAT-server/lib/xcat/plugins/dhcp.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 08447e4c8..da337392d 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -1601,10 +1601,15 @@ sub process_request my $generatedpath = "$syspath/$dhcpver"; my $dhcpd_key = "DHCPDARGS"; - if ($os =~ /sles/i || $os =~ /rhels7/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 11 and RHEL7, the dhcpd6/dhcpd config are stored in the same file $dhcpd_key = "DHCPD6_INTERFACE"; $generatedpath = "$syspath/dhcpd"; }