From f012fe2dadf251527f9a657ffe46513b6cec6a43 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 14 Jul 2009 15:55:31 +0000 Subject: [PATCH] -Support FQDN in makehosts git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3777 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/hosts.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/hosts.pm b/xCAT-server/lib/xcat/plugins/hosts.pm index 3efaaf833..7b5eeab88 100644 --- a/xCAT-server/lib/xcat/plugins/hosts.pm +++ b/xCAT-server/lib/xcat/plugins/hosts.pm @@ -70,8 +70,11 @@ sub build_line { } } - if ($domain && !$longname) { - $longname="$node.$domain"; + if ($node =~ m/\.$domain$/i) { + $longname = $node; + $node =~ s/\.$domain$//; + } elsif ($domain && !$longname) { + $longname="$node.$domain"; } $othernames=join(' ', @o_names);