Clean up hostname grain a bit

This commit is contained in:
Thomas S Hatch 2011-04-29 16:20:13 -06:00
parent 5c1f559ab6
commit a09fc4584e

View File

@ -129,9 +129,11 @@ def hostname():
stdout=subprocess.PIPE).communicate()[0].strip()
domain = subprocess.Popen(['dnsdomainname'],
stdout=subprocess.PIPE).communicate()[0].strip()
return {'host': host,
'domain': domain,
'fqdn': host + '.' + domain}
grains = {'host': host}
if domain:
grains['domain'] = domain
grains['fqdn'] = host + '.' + domain
return grains
def path():
'''