From 2507fafbb4cfd2a2cbe279a929502ae3658aa8b1 Mon Sep 17 00:00:00 2001 From: nott Date: Fri, 2 Nov 2012 14:01:38 +0000 Subject: [PATCH] changes for multi-domain support git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14229 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/makeknownhosts.pm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/makeknownhosts.pm b/xCAT-server/lib/xcat/plugins/makeknownhosts.pm index db5572905..478ba8fd9 100644 --- a/xCAT-server/lib/xcat/plugins/makeknownhosts.pm +++ b/xCAT-server/lib/xcat/plugins/makeknownhosts.pm @@ -252,17 +252,18 @@ sub add_known_host if (defined $hostname) { - my $sitedomain; - my @domain = xCAT::TableUtils->get_site_attribute("domain"); - if ($domain[0]) - { - $sitedomain = $domain[0]; - } + my $hostdomain; + my @hosts; + push (@hosts, $hostname); + my $nd = xCAT::NetworkUtils->getNodeDomains(\@hosts); + my %nodedomains = %$nd; + $hostdomain = $nodedomains{$hostname}; + $line = "\""; $line .= "$hostname,"; - if ($sitedomain) + if ($hostdomain) { - $line .= "$hostname.$sitedomain,"; + $line .= "$hostname.$hostdomain,"; } $line .= "$ip_address"; $line .= " ";