Use platform.node() for the hostname, leave fqdn calculated the same way

pull/2594/merge
Michael DeHaan 12 years ago
parent 6a00513731
commit 22e3c389b3

@ -3,7 +3,7 @@
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# #
# This file is part of Ansible #n This file is part of Ansible
# #
# Ansible is free software: you can redistribute it and/or modify # Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # 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['machine'] = platform.machine()
self.facts['python_version'] = platform.python_version() self.facts['python_version'] = platform.python_version()
self.facts['fqdn'] = socket.getfqdn() 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:]) self.facts['domain'] = '.'.join(self.facts['fqdn'].split('.')[1:])
if self.facts['machine'] == 'x86_64': if self.facts['machine'] == 'x86_64':
self.facts['architecture'] = self.facts['machine'] self.facts['architecture'] = self.facts['machine']

Loading…
Cancel
Save