Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: Add missing 'commit' configuration and manual disconnects
  • Loading branch information
sbyrnes committed Mar 19, 2024
1 parent 5a5d196 commit 081491b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lab-1/1_netmiko_lldp_neighbors_raw.py
Expand Up @@ -24,3 +24,5 @@
f"### This is the raw output from {host}, without any parsing: ###\n",
raw_output + "\n",
)

connection.disconnect()
2 changes: 2 additions & 0 deletions lab-1/2_netmiko_lldp_neighbors_textfsm.py
Expand Up @@ -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()
Expand Up @@ -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()
2 changes: 2 additions & 0 deletions lab-2/4_netmiko_ciscoconfparse_update_helper_addrs.py
Expand Up @@ -56,4 +56,6 @@
connection.send_config_set(commands)
print(f"After:{connection.send_command(f'show run {intf_name}')}")

connection.disconnect()

print("Done!")

0 comments on commit 081491b

Please sign in to comment.