I am running Python 3 on a Windows 10 computer. When I run this it works fine. When I add the use_textfsm=True) to the results I get a permission error where the templates are at. Permissions seem to be fine. I would like to try copy the template folder to a new location but I am not sure how to tell netmiko the new location for that folder.
from nornir import InitNornir
from nornir.core.task import Result, Task
from nornir_netmiko.tasks.netmiko_send_command import netmiko_send_command
from nornir_utils.plugins.functions import print_result
nr = InitNornir("h:/Scripts/IPvZero-master/nornir_textFSM_video/config.yaml")
results = nr.run(netmiko_send_command, command_string="show interface switchport")
print_result(results)*
TextFSM Integration
Netmiko has been configured to automatically look in ~/ntc-template/templates/index for the ntc-templates index file. Alternatively, you can explicitly tell Netmiko where to look for the TextFSM template directory by setting the NET_TEXTFSM environment variable (note, there must be an index file in this directory):
export NET_TEXTFSM=/path/to/ntc-templates/templates/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…