nornir 3.3.0 Perform operations on h3c switches,Result display exception #848
Unanswered
wanghuan12345678
asked this question in
Q&A
Replies: 2 comments 1 reply
-
I tried to change the nornir version back to 3.0.0 and it worked |
Beta Was this translation helpful? Give feedback.
0 replies
-
@wanghuan12345678 Which version of Netmiko are you using in the above two cases (i.e. working and failing case)? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After the script is executed, no operation result is displayed, but operation logs are displayed on the switch
[root@localhost table-test]# pip freeze |grep nornir
nornir==3.3.0
nornir-napalm==0.4.0
nornir-netmiko==1.0.0
nornir-utils==0.2.0
[root@localhost pystudy]# vim nornir-h3c.py
from nornir import InitNornir
from nornir_napalm.plugins.tasks import napalm_get
from nornir_netmiko import netmiko_send_config,netmiko_save_config,netmiko_send_command
from nornir_utils.plugins.functions import print_result
from nornir.core.filter import F
nr = InitNornir(config_file="config.yaml", dry_run=True)
targets = nr.filter(F(area='SH'))
results = targets.run(netmiko_send_command, command_string='dis clock')
#results = targets.run(task=napalm_get, getters=["get_interfaces_ip"])])
print_result(results
[root@localhost pystudy]# python nornir-h3c.py
netmiko_send_command************************************************************
vvvv netmiko_send_command ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
^^^^ END netmiko_send_command ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[root@localhost pystudy]#
Beta Was this translation helpful? Give feedback.
All reactions