Beispiel #1
0
def main():
    device = open_napalm_connection(nxos1)
    device.open()
    create_checkpoint(device)
    device.load_replace_candidate(filename='ex4c_nxos1.cfg')
    pprint(device.compare_config())
    device.discard_config()
    pprint(device.compare_config())
Beispiel #2
0
def main():
    conns = list()
    devices = cisco3, arista1
    for dev in devices:
        conns.append(open_napalm_connection(dev))
    print(conns)
    for con in conns:
        con.open()
        pprint(con.get_arp_table())
Beispiel #3
0
def main():
    conns = list()
    devices = cisco3, arista1
    for dev in devices:
        conns.append(open_napalm_connection(dev))
    print(conns)
    for con in conns:
        con.open()
        try:
            create_backup(con)
        except Exception:
            print('ERROR in backup')
Beispiel #4
0
def main():
    conns = list()
    devices = cisco3, arista1
    for dev in devices:
        conns.append(open_napalm_connection(dev))
    print(conns)
    for con in conns:
        con.open()
        try:
            pprint(con.get_ntp_peers())
        except NotImplementedError:
            print('NTP not configured')
Beispiel #5
0
def main():
    conns = list()
    devices = cisco3, arista1
    for dev in devices:
        conns.append(open_napalm_connection(dev))
    print(conns)
    for con in conns:
        if con.hostname == cisco3.get('hostname'):
            config = 'cisco3.lasthop.io-loopbacks'
        elif con.hostname == arista1.get('hostname'):
            config = 'arista1.lasthop.io-loopbacks'
        print(config)
        con.open()
        con.load_merge_candidate(filename=config)
        pprint(con.compare_config())
        con.close()
Beispiel #6
0
def main():
    conns = list()
    devices = cisco3, arista1
    for dev in devices:
        conns.append(open_napalm_connection(dev))
    print(conns)
    for con in conns:
        if con.hostname == cisco3.get('hostname'):
            config = 'cisco3.lasthop.io.loopbacks'
        elif con.hostname == arista1.get('hostname'):
            config = 'arista1.lasthop.io.loopbacks'
        con.open()
        try:
            con.load_merge_candidate(config)
            pprint(con.compare_configs())
        except Exception:
            print('ERROR in merge')
Beispiel #7
0
def main():
    device = open_napalm_connection(nxos1)
    device.open()
    create_checkpoint(device)
Beispiel #8
0
def main():
    conns = list()
    devices = cisco3, arista1
    for dev in devices:
        conns.append(open_napalm_connection(dev))
    print(conns)