我正在尝试使用 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)
找不到我的问题的解决方案。任何帮助是极大的赞赏!