Beispiel #1
0
from pprint import pprint
from napalm import get_network_driver
from my_devices import nxos1
from my_functions import create_con,create_checkpoint
 
nxos1_con = create_con(nxos1)

create_checkpoint(nxos1_con)

print("Open connection")
nxos1_con.open()
print("Load the change:")
nxos1_con.load_replace_candidate(filename="nxos1.conf.new")
print("Config diff:")
print(nxos1_con.compare_config())
print("Discard the change")
nxos1_con.discard_config()
print("Config diff:")
print(nxos1_con.compare_config())
print("Close connection")
nxos1_con.close()
Beispiel #2
0
from pprint import pprint
from napalm import get_network_driver
from my_devices import cisco3,arista1
from my_functions import create_con

con_list = []

arista = create_con(arista1)
con_list.append(arista)

cisco =  create_con(cisco3)
con_list.append(cisco)

for elem in con_list:
    elem.open()
    print("Platform:")
    print(elem.platform)
    print("Driver:")
    print(elem)
    print("Device facts:")
    pprint(elem.get_facts())
    print("----------------")
    elem.close()