I want to create about a dozen or-so python scripts that will talk to network devices, most of them will do some sort of telnet/ssh/snmp action, either getting info or modifying it.
In perl I normally would use a nested hash which works ok, tried to re-write this to a nested dictionary in python and this works.... but I'm not sure if I should use classes or not. Basically the most important data structures that I need are things:
"workunit", basically a device with a number of properties like ipaddress, hostname, log_file_locations, results etc..
"settings" and "transport" dictionary which basically says are we doing ssh or snmp and what are the settings for it (userid/password, community string etc..)
So if I run a script for example for 10 devices, then I will normally have a dictionary of dictionaries with the ipaddress as a key to that dict.
I could also of course create a "Workunit" class, and create a basic list of "Workunit" objects, but the more I read about python the less "pythonic?" it feels... Any insight to what the "right" approach is in this case? (both will work I'm sure).