Commit 3a1ea1e2 authored by Simon Redman's avatar Simon Redman

Make use of new ssh helpers

parent 6732d9b8
......@@ -198,11 +198,7 @@ if __name__ == "__main__":
args = parser.parse_args()
netgraph = NetJsonParser(file=args.in_file)
hostnames = [node for node in netgraph.graph.nodes]
usernames = [args.username for i in range(len(hostnames))]
sessions, passwords = ssh_helper.log_in_many_sessions(hostnames, usernames)
for host_idx in range(len(hostnames)):
netgraph.graph._node[hostnames[host_idx]]['session'] = sessions[host_idx]
ssh_helper.network_graph_login(netgraph.graph, args.username)
link_local_map = parse_local_interface_addresses(netgraph.graph)
ipv4_map = parse_ipv4_networks(netgraph.graph)
......@@ -210,8 +206,5 @@ if __name__ == "__main__":
add_ULAs_to_hosts(netgraph.graph, ULA_map)
for node in netgraph.graph._node:
session = netgraph.graph._node[node]['session']
del netgraph.graph._node[node]['session']
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment