From 13b0b37560681f9b6fb525a0015995ccef97d87d Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 22 Jul 2016 02:24:28 -0400 Subject: [PATCH] fix issue [DEV] "makehosts" generates the /etc/hosts entries with wrong domain name for node with "otherinterfaces" attribute #1575 --- xCAT-server/lib/xcat/plugins/hosts.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/hosts.pm b/xCAT-server/lib/xcat/plugins/hosts.pm index 8f64c8913..f384ae82a 100755 --- a/xCAT-server/lib/xcat/plugins/hosts.pm +++ b/xCAT-server/lib/xcat/plugins/hosts.pm @@ -203,6 +203,13 @@ sub addotherinterfaces { $itf = $node . $itf; } + + #lookup the domain for the ip address + #if failed, use the domain passed in + my ($mydomain,$mynet)=getIPdomain($ip); + if($mydomain){ + $domain=$mydomain; + } addnode $callback, $itf, $ip, '', $domain; } }