diff --git a/lab-1/1_netmiko_lldp_neighbors_raw.py b/lab-1/1_netmiko_lldp_neighbors_raw.py index cc82ee9..f444ce6 100644 --- a/lab-1/1_netmiko_lldp_neighbors_raw.py +++ b/lab-1/1_netmiko_lldp_neighbors_raw.py @@ -24,3 +24,5 @@ f"### This is the raw output from {host}, without any parsing: ###\n", raw_output + "\n", ) + + connection.disconnect() diff --git a/lab-1/2_netmiko_lldp_neighbors_textfsm.py b/lab-1/2_netmiko_lldp_neighbors_textfsm.py index 73bd751..6070bf8 100644 --- a/lab-1/2_netmiko_lldp_neighbors_textfsm.py +++ b/lab-1/2_netmiko_lldp_neighbors_textfsm.py @@ -28,3 +28,5 @@ print(f"### This is the TextFSM output from {host}, but JSON-formatted to be prettier: ###") print(json.dumps(textfsm_output, indent=4)) # indent for readability print("\n") # Add extra space between our outputs for each host + + connection.disconnect() \ No newline at end of file diff --git a/lab-2/3_netmiko_textfsm_update_description_to_lldp_neighbors.py b/lab-2/3_netmiko_textfsm_update_description_to_lldp_neighbors.py index 8310b02..0d84a6e 100644 --- a/lab-2/3_netmiko_textfsm_update_description_to_lldp_neighbors.py +++ b/lab-2/3_netmiko_textfsm_update_description_to_lldp_neighbors.py @@ -57,9 +57,12 @@ configuration = [ f"int {my_interface}", - f"description -> {neighbor_name}, {neighbor_interface}" + f"description -> {neighbor_name}, {neighbor_interface}", + "commit" ] print(f"Before:{connection.send_command(f'show run int {my_interface}')}") connection.send_config_set(configuration) print(f"After:{connection.send_command(f'show run int {my_interface}')}") + + connection.disconnect() diff --git a/lab-2/4_netmiko_ciscoconfparse_update_helper_addrs.py b/lab-2/4_netmiko_ciscoconfparse_update_helper_addrs.py index 43824db..1f11ae7 100644 --- a/lab-2/4_netmiko_ciscoconfparse_update_helper_addrs.py +++ b/lab-2/4_netmiko_ciscoconfparse_update_helper_addrs.py @@ -56,4 +56,6 @@ connection.send_config_set(commands) print(f"After:{connection.send_command(f'show run {intf_name}')}") + connection.disconnect() + print("Done!")