Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
361 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...