Iterating over a dictionary
To loop over a dict, use thedict2items:
Here, we are iterating overserver_configsand printing the key and selected nested fields.
If the values in the dictionary are themselves dictionaries (for example, each group maps
to a dict containing agid), remember that after applyingdict2itemseach loop item
has two attributes:item.keyanditem.value. Access nested fields viaitem.value.
.