From 22e3c389b32eb2ddcb05bdebeb4dae27de92b134 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Tue, 16 Apr 2013 20:10:21 -0400 Subject: [PATCH] Use platform.node() for the hostname, leave fqdn calculated the same way --- library/setup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/setup b/library/setup index 3b1e988ca8..6ea257d5a6 100644 --- a/library/setup +++ b/library/setup @@ -3,7 +3,7 @@ # (c) 2012, Michael DeHaan # -# This file is part of Ansible +#n This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -139,7 +139,7 @@ class Facts(object): self.facts['machine'] = platform.machine() self.facts['python_version'] = platform.python_version() self.facts['fqdn'] = socket.getfqdn() - self.facts['hostname'] = self.facts['fqdn'].split('.')[0] + self.facts['hostname'] = platform.node() self.facts['domain'] = '.'.join(self.facts['fqdn'].split('.')[1:]) if self.facts['machine'] == 'x86_64': self.facts['architecture'] = self.facts['machine']