May-18-2019, 12:12 PM
You are appending the same dictionary every time. Unless you do an explicit copy of a dictionary, whenever you modify the dictionary, you modify every other instance of the dictionary you left laying about. That's because the variables are just pointing to the (same) dictionary, not hosting independent versions of it.
I would just condense lines 34-36 into one line:
I would just condense lines 34-36 into one line:
interface_list.append({'switch_ip': reachable_sw, 'port': interface})
.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures