@@ -0,0 +1,1739 @@
+import os%0Aimport paramiko%0Aimport sys%0A%0Anexus_ip = os.environ.get('NEXUS_IP')%0Anexus_user = os.environ.get('NEXUS_USER')%0Anexus_password = os.environ.get('NEXUS_PASSWORD')%0Anexus_intf_num = os.environ.get('NEXUS_INTF_NUM')%0Anexus_vlan_start = os.environ.get('NEXUS_VLAN_START')%0Anexus_vlan_end = os.environ.get('NEXUS_VLAN_END')%0A%0A%0Adef clear_nexus_config(ip, user, password, intf_num, vlan_start, vlan_end):%0A    client = paramiko.client.SSHClient()%0A    client.load_system_host_keys()%0A%0A    for vlan in range(int(vlan_start), int(vlan_end) + 1):%0A        client.connect(ip, username=user, password=password)%0A%0A        cmd = 'config terminal ; ' %5C%0A              'interface Ethernet %7B0%7D ; ' %5C%0A              'switchport trunk allowed vlan remove %7B1%7D ;'.format(intf_num, vlan)%0A        print cmd%0A        stdin, stdout, stderr = client.exec_command(cmd)%0A        print stdout.readlines()%0A%0A        cmd = 'config terminal ; no vlan %7B0%7D ;'.format(vlan)%0A        print cmd%0A        stdin, stdout, stderr = client.exec_command(cmd)%0A        print stdout.readlines()%0A%0A        client.close()%0A%0Adef print_usage():%0A    print %22Usage:%22%0A    print %22    python %25s %3Cnexus-ip%3E %3Cuser%3E %3Cpassword%3E %22 %25 sys.argv%5B0%5D%0A    print %22              %3Cintf-num%3E %3Cvlan-start%3E %3Cvlan-end%3E%22%0A    print %22Example:%22%0A    print %22    python %25s 10.0.1.32 admin MyPassword 1/9 810 813%22 %25 sys.argv%5B0%5D%0A    print %22Note: VLAN range is inclusive.%22%0A    print %22Note: Number of VLANs in VLAN range should not exceed 100.%22%0A%0Aif __name__ == '__main__':%0A    if %22--help%22 in sys.argv:%0A        print_usage()%0A        sys.exit(0)%0A    if len(sys.argv) != 7:%0A        print_usage()%0A        sys.exit(1)%0A    clear_nexus_config(sys.argv%5B1%5D, sys.argv%5B2%5D, sys.argv%5B3%5D,%0A                       sys.argv%5B4%5D, sys.argv%5B5%5D, sys.argv%5B6%5D)%0A

Add new clear_nexus script