From e2a8a68c8537c0ba6e7c0ebec53612b182dfe5b1 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Fri, 7 Aug 2015 00:28:17 -0400 Subject: [PATCH] Cleaning up some debugging/commented code from #11709 --- contrib/inventory/cobbler.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/contrib/inventory/cobbler.py b/contrib/inventory/cobbler.py index 433f9bab293..469fac21ad5 100755 --- a/contrib/inventory/cobbler.py +++ b/contrib/inventory/cobbler.py @@ -169,19 +169,13 @@ class CobblerInventory(object): dns_name = host['hostname'] #None ksmeta = None interfaces = host['interfaces'] - #for (iname, ivalue) in interfaces.iteritems(): - # if ivalue['management']: - # this_dns_name = ivalue.get('dns_name', None) - # #this_dns_name = ivalue.get('ip_address', None) - # if this_dns_name is not None and this_dns_name is not "": - # dns_name = this_dns_name if dns_name is None: continue status = host['status'] profile = host['profile'] - classes = host[orderby_keyname] #host['mgmt_classes'] + classes = host[orderby_keyname] if status not in self.inventory: self.inventory[status] = [] @@ -200,7 +194,7 @@ class CobblerInventory(object): # The old way was ksmeta only -- provide backwards compatibility - self.cache[dns_name] = host #dict() # sub dict with host to output json + self.cache[dns_name] = host if "ks_meta" in host: for key, value in host["ks_meta"].iteritems(): self.cache[dns_name][key] = value @@ -249,7 +243,6 @@ class CobblerInventory(object): def write_to_cache(self, data, filename): """ Writes data in JSON format to a file """ - #if data: print "DEBUG: data = " + str(data) json_data = self.json_format_dict(data, True) cache = open(filename, 'w') cache.write(json_data)