Below is the "data" dict
{' node2': {'Status': ' online', 'TU': ' 900', 'Link': ' up', 'Port': ' a0a-180', 'MTU': ' 9000'}, ' node1': {'Status': ' online', 'TU': ' 900', 'Link': ' up', 'Port': ' a0a-180', 'MTU': ' 9000'}}
I am trying key node2 is present or not in data dict in below code but it is not working. Please help
if 'node2' in data:
print "node2 Present"
else:
print "node2Not present"