Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import netmiko
- import json
- import getpass2
- 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
- net_connect = ConnectHandler(**cisco_881)
- 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: ")
- int.device_type
- if device_type == {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.}:
- device_profile = {
- 'device_type': 'cisco_nxos',
- 'ip': connection_IP,
- 'username': connection_USER,
- 'password': connection_PSW,
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement