net_connect.send_config_set(config_commands) is working in pycharm however net_connect.send_command is working fine.

While doing SSH to the target switch, net_connect.send_command is working for one program however

net_connect.send_config_set(config_commands)

is not working.


from netmiko import Netmiko

iosv_l2 = {
'device_type': 'cisco_ios',
'ip': 'x.x.x.x',
'username': 'xxxxx',
'password': 'xxxxx'
}

net_connect = Netmiko(**iosv_l2)
output = net_connect.send_command('show ip int brief')
print(output)

config_commands = ['int loop 0', 'ip address 1.1.1.1 255.255.255.0']
output = net_connect.send_config_set(config_commands)
print(output)

for n in range(2, 21):
print("Creating VLAN " + str(n))
config_commands = ['vlan ' + str(n), 'name Python_VLAN ' + str(n)]
output = net_connect.send_config_set(config_commands)
print(output)





I can see result for below Snnipt

net_connect = Netmiko(**iosv_l2)
output = net_connect.send_command('show ip int brief')
print(output)

Can someone help me

Please sign in to leave a comment.