简体   繁体   English

使用jnpr.junos.utils.config加载命令时的RPC错误

[英]RPC Error when using jnpr.junos.utils.config Load command

still rather new to Python. 对Python来说还是很新的。 I've been referencing a few blogs regarding the jnpr.junos packages. 我一直在参考有关jnpr.junos软件包的一些博客。 Specifically from Jeremy Schulman ( http://forums.juniper.net/t5/Automation/Python-for-Non-Programmers-Part-2/bc-p/277682 ). 特别是来自Jeremy Schulman( http://forums.juniper.net/t5/Automation/Python-for-Non-Programmers-Part-2/bc-p/277682 )。 I'm simply trying to make sure I have the commands right. 我只是想确保我的命令正确。 I'm just attempting to pass simple commands to my SRX cluster. 我只是试图将简单的命令传递给我的SR​​X群集。 I'm attempting to pass the following to an SRX650 cluster. 我正在尝试将以下内容传递给SRX650群集。

>>> from jnpr.junos.utils.config import Config
>>> from jnpr.junos import Device
>>> dev = Device(host='devip',user='myuser',password='mypwd')
>>> dev.open()
Device(devip)
>>> cu = Config(dev)
>>> cu
jnpr.junos.utils.Config(devip)
>>> set_cmd = 'set system login message "Hello Admin!"'
>>> cu.load(set_cmd,format='set')

Warning (from warnings module):
File "C:\Python27\lib\site-packages\junos_eznc-1.0.0-                py2.7.egg\jnpr\junos\utils\config.py", line 273
if any([e.find('[error-severity="error"]') for e in rerrs]):
FutureWarning: The behavior of this method will change in future versions.     Use specific 'len(elem)' or 'elem is not None' test instead.

Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
cu.load(set_cmd,format='set')
File "C:\Python27\lib\site-packages\junos_eznc-1.0.0-   py2.7.egg\jnpr\junos\utils\config.py", line 296, in load
return try_load(rpc_contents, rpc_xattrs)
File "C:\Python27\lib\site-packages\junos_eznc-1.0.0-py2.7.egg\jnpr\junos\utils\config.py", line 274, in try_load
raise err
RpcError

I've done quite a bit of searching and can't seem to find anything as to why this RPC error is popping up. 我已经做了大量的搜索工作,但是似乎找不到关于为何弹出此RPC错误的任何信息。 I've confirmed that the syntax is correct and read through the jnpr.junos documentation for Junos EZ. 我已经确认语法正确,并已阅读Junos EZ的jnpr.junos文档。

Found that I was using an outdated version of junos.eznc. 发现我正在使用junos.eznc的过时版本。 Running pip install -U junos-eznc updated me to junos.eznc 1.3.1. 运行pip install -U junos-eznc将我更新为junos.eznc 1.3.1。 After doing this, my script worked properly. 完成此操作后,我的脚本正常运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导入错误:使用 pickle.load 时没有名为“utils”的模块 - Import error: No module named “utils” when using pickle.load JUNOS PYEZ:在 SET 命令中覆盖设备的基本配置 - JUNOS PYEZ: Over write the Base config of a Device in SET command PyEZ:jnpr.junos.exception.ConnectRefusedError:ConnectRefusedError(xx.xxx.xxx.xxx) - PyEZ: jnpr.junos.exception.ConnectRefusedError: ConnectRefusedError(xx.xxx.xxx.xxx) 尝试使用 keras.utils.get_file() 加载数据时出错 - Getting error when trying to load data using keras.utils.get_file() 使用aria2的RPC接口时如何配置超时? - How to config timeout when using the RPC interface of aria2? 从Python执行时,Junos Device CLI命令给出错误的输出 - Junos Device CLI command giving wrong output when executed from python 从 tensorflow object 检测工具导入 config_util 时出现导入错误 - Import error when importing config_util from tensorflow object detection utils 执行“导入 tensorflow.keras.utils.np_utils”时出错 - Error when doing "import tensorflow.keras.utils.np_utils" Python - 解析 Junos 路由器配置以连续显示数据 - Python - Parsing Junos Router Config to display data in a row Junos_config在Ansible 2.5 python jsonDecoderError中不再起作用 - Junos_config not working anymore with ansible 2.5 python jsonDecoderError
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM