Commit ae865b94 by James Cammarata

Merge pull request #12150 from opoplawski/cobbler

Fix setting dns_name in cobbler inventory
parents a341a8a0 3b17efe5
......@@ -169,8 +169,15 @@ class CobblerInventory(object):
dns_name = host['hostname'] #None
ksmeta = None
interfaces = host['interfaces']
if dns_name is None:
# hostname is often empty for non-static IP hosts
if dns_name == '':
for (iname, ivalue) in interfaces.iteritems():
if ivalue['management'] or not ivalue['static']:
this_dns_name = ivalue.get('dns_name', None)
if this_dns_name is not None and this_dns_name is not "":
dns_name = this_dns_name
if dns_name == '':
continue
status = host['status']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment