我正在尝试使用PyEZ加载覆盖存储在杜松设备(vSRX)上的配置。代码看起来像这样
from jnpr.junos import Device
from jnpr.junos.utils.config import Config
dev = Device(host="x.x.x.x", user='user', password='pass').open()
with Config(dev, mode='private') as cu:
cu.load('load override minimal.conf', format='set')
cu.pdiff()
if cu.commit_check():
cu.commit()
运行脚本时出现以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/jnpr/junos/utils/config.py", line 534, in load
ignore_warning=ignore_warning)
File "/usr/local/lib/python2.7/dist-packages/jnpr/junos/utils/config.py", line 455, in try_load
raise ConfigLoadError(cmd=err.cmd, rsp=err.rsp, errs=err.errs)
jnpr.junos.exception.ConfigLoadError: ConfigLoadError(severity: error, bad_element: load, message: error: unknown command)
找不到解决我问题的方法。任何帮助是极大的赞赏!
答案 0 :(得分:1)
如果您尝试从本地文件(在junos设备上)加载配置,则应使用url
选项
检查网址:
答案 1 :(得分:0)