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

Add a fact providing the full hostname, without the domain portion
pull/5205/merge
Michael DeHaan 11 years ago
commit 9921f804f9

@ -108,6 +108,7 @@ class Facts(object):
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'] = platform.node().split('.')[0] self.facts['hostname'] = platform.node().split('.')[0]
self.facts['nodename'] = platform.node()
self.facts['domain'] = '.'.join(self.facts['fqdn'].split('.')[1:]) self.facts['domain'] = '.'.join(self.facts['fqdn'].split('.')[1:])
arch_bits = platform.architecture()[0] arch_bits = platform.architecture()[0]
self.facts['userspace_bits'] = arch_bits.replace('bit', '') self.facts['userspace_bits'] = arch_bits.replace('bit', '')

Loading…
Cancel
Save