From 4e11f026effa2b114f997a194f478c4d42cf969a Mon Sep 17 00:00:00 2001 From: nott Date: Tue, 16 Jul 2013 16:33:33 +0000 Subject: [PATCH] add check for sles10 and rh5 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16983 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/dhcp.pm | 53 ++++++++++++++++------------ 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index c42cda5c5..46963a50e 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -1920,19 +1920,23 @@ sub addnet6 my $netdomain = $netcfgs{$net}->{domain}; unless ($netdomain) { $netdomain = $site_domain; } push @netent, " option domain-name \"".$netdomain."\";\n"; - # add domain-search - # We want something like "option domain-search "foo.com", "bar.com";" - my $domainstring = qq~"$netcfgs{$net}->{domain}"~; - foreach my $dom (@alldomains) { - chomp $dom; - if ($dom ne $netcfgs{$net}->{domain}){ - $domainstring .= qq~, "$dom"~; - } - } - if ($netcfgs{$net}->{domain}) { - push @netent, " option domain-search $domainstring;\n"; - } + # add domain-search if not sles10 or rh5 + my $osv = xCAT::Utils->osver(); + unless ( ($osv =~ /^sle[sc]10/) || ($osv =~ /^rh.*5$/) ) { + # We want something like "option domain-search "foo.com", "bar.com";" + my $domainstring = qq~"$netcfgs{$net}->{domain}"~; + foreach my $dom (@alldomains) { + chomp $dom; + if ($dom ne $netcfgs{$net}->{domain}){ + $domainstring .= qq~, "$dom"~; + } + } + + if ($netcfgs{$net}->{domain}) { + push @netent, " option domain-search $domainstring;\n"; + } + } my $nameservers = $netcfgs{$net}->{nameservers}; if ($nameservers and $nameservers =~ /:/) { @@ -2208,18 +2212,21 @@ sub addnet push @netent, " option domain-name-servers $nameservers;\n"; } - # add domain-search - # We want something like "option domain-search "foo.com", "bar.com";" - my $domainstring = qq~"$domain"~; - foreach my $dom (@alldomains) { - chomp $dom; - if ($dom ne $domain){ - $domainstring .= qq~, "$dom"~; - } - } + # add domain-search if not sles10 or rh5 + my $osv = xCAT::Utils->osver(); + unless ( ($osv =~ /^sle[sc]10/) || ($osv =~ /^rh.*5$/) ) { + # want something like "option domain-search "foo.com", "bar.com";" + my $domainstring = qq~"$domain"~; + foreach my $dom (@alldomains) { + chomp $dom; + if ($dom ne $domain){ + $domainstring .= qq~, "$dom"~; + } + } - if ($domain) { - push @netent, " option domain-search $domainstring;\n"; + if ($domain) { + push @netent, " option domain-search $domainstring;\n"; + } } my $ddnserver = $nameservers;