i have the following nested dictionary:
{'switch3': {'ip': '192.160.1.2', 'hostname': 'test-1'},
'switch2': {'ip': '192.160.1.8', 'hostname': 'test-1'},
'switch4': {'ip': '192.160.1.3', 'hostname': 'test-1'},
'switch1': {'ip': '192.160.1.4', 'hostname': 'test-1'}}
and i want to sort by switch, and get this :
{'switch1': {'ip': '192.160.1.4', 'hostname': 'test-1'}
'switch2': {'ip': '192.160.1.8', 'hostname': 'test-1'},
'switch3': {'ip': '192.160.1.2', 'hostname': 'test-1'},
'switch4': {'ip': '192.160.1.3', 'hostname': 'test-1'}}
is this possible ?