I added code tags for you.
It's so much easier to read a dictionary if written like:
It's so much easier to read a dictionary if written like:
bond0: { 'MII Status:': 'up', 'Aggregator ID:': '2', 'Slave Interfaces': { 'p1p1': { 'MII Status': 'up', 'Permanent HW addr': '9c:dc:71:45:eb:80', 'MII Status': up }, 'p4p1': { 'MII Status' : 'up', 'Permanent HW addr': '9c:dc:71:4d:80:20', 'MII Status': up } } }you can use something like the following to traverse a nested dictionary:
def display_dict(thedict): for key, value in thedict.items(): if isinstance(value, dict): print(f'{key}:') self.display_dict(value) else: print(f' {key}: {value}') display_dict(bond0)This also corrects errors you had in your definition