Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from netmiko import ConnectHandler
- import json
- import getpass2
- #device_list = {1 : "cisco_ios" , 2 : "cisco_xe", 3: "cisco_asa", 4: "cisco_nxos",5: "cisco_xr", 6: "cisco_wlc_ssh", 7:"arista_eos", 8:"hp_procurve", 9: "hp_comware", 10: "huawei", 11: "f5_ltm", 12: "juniper", 13: "brocade_vdx"}
- class Credentials:
- def __init__(self):
- self.ip = raw_input("Enter IP:")
- self.username = raw_input("Enter Username:")
- self.password = raw_input("Enter Password:")
- self.secret = raw_input("Enter Enable Secret:")
- self.port = raw_input("Enter Port Number:")
- connection = Credentials()
- connection_IP = connection.ip
- connection_USER = connection.username
- connection_PSW = connection.password
- print("1.cisco_ios, 2.cisco_xe, 3.cisco_asa, 4.cisco_nxos, 5.cisco_xr, 6.cisco_wlc_ssh, \n"
- "7.arista_eos, 8.hp_procurve, 9.hp_comware, 10.huawei, 11.f5_ltm, 12.juniper, 13.brocade_vdx.")
- device_type = raw_input("What type of device: ")
- device_profile = {
- 'device_type': device_type,
- 'ip': connection_IP,
- 'username': connection_USER,
- 'password': connection_PSW,
- }
- net_connect = ConnectHandler(**device_profile)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement