[python] convert dictionary to yaml and vice versa

Nornir framework comes with the pyyaml module installed, hence I do not need to install pyyaml. Convert dictionary to yaml The purpose is to accept json data from the api gateway and convert this into yaml in the backend to be sent over to ansible through nornir. The below is a test on convert dictionary … Continue reading [python] convert dictionary to yaml and vice versa

[python] Iterate a dictionary

The list data type is easy to iterate by using for item in items where item is the object in the list - items. Suppose to iterate through datas within a dictionary, using this as the dictionary: example = { 'object_name': 'linux', 'address': '', 'mask': '', 'gateway': '', 'prefix': '24' } Returns both the keys … Continue reading [python] Iterate a dictionary