Merge pull request #6643 from herbygillot/fact-full-hostname

Add a fact providing the full hostname, without the domain portion
This commit is contained in:
Michael DeHaan 2014-03-27 17:09:34 -04:00
commit 9921f804f9

View file

@ -108,6 +108,7 @@ class Facts(object):
self.facts['python_version'] = platform.python_version()
self.facts['fqdn'] = socket.getfqdn()
self.facts['hostname'] = platform.node().split('.')[0]
self.facts['nodename'] = platform.node()
self.facts['domain'] = '.'.join(self.facts['fqdn'].split('.')[1:])
arch_bits = platform.architecture()[0]
self.facts['userspace_bits'] = arch_bits.replace('bit', '')