1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Since using platform.node, be sure to just return the hostname component.

This commit is contained in:
Michael DeHaan 2013-04-20 09:24:59 -04:00
parent 6e1514e975
commit cfe8af493f

View file

@ -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'] = platform.node()
self.facts['hostname'] = platform.node().split('.')[0]
self.facts['domain'] = '.'.join(self.facts['fqdn'].split('.')[1:])
if self.facts['machine'] == 'x86_64':
self.facts['architecture'] = self.facts['machine']