Closed mirceaulinic closed 7 years ago
Easy to reproduce:
>>> d.cli('show ntp associations no-resolve')
'\n remote refid st t when poll reach delay offset jitter\n===============================================================================\n 1.2.3.4 .INIT. 16 - - 1024 0 0.000 0.000 4000.00\n'
>>> j.get_ntp_stats()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/napalm_junos/junos.py", line 888, in get_ntp_stats
ntp_assoc_output = self.device.cli('show ntp associations no-resolve')
File "/usr/local/lib/python2.7/dist-packages/jnpr/junos/device.py", line 600, in cli
rpc_string = self.cli_to_rpc_string(command)
File "/usr/local/lib/python2.7/dist-packages/jnpr/junos/device.py", line 548, in cli_to_rpc_string
rpc_string = "rpc.%s(" % (rpc.tag.replace('-', '_'))
AttributeError: 'unicode' object has no attribute 'tag'
>>> from __future__ import unicode_literals
>>> d.cli('show ntp associations no-resolve')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/jnpr/junos/device.py", line 600, in cli
rpc_string = self.cli_to_rpc_string(command)
File "/usr/local/lib/python2.7/dist-packages/jnpr/junos/device.py", line 548, in cli_to_rpc_string
rpc_string = "rpc.%s(" % (rpc.tag.replace('-', '_'))
AttributeError: 'unicode' object has no attribute 'tag'
This will be tracked under https://github.com/Juniper/py-junos-eznc/pull/721
Description of Issue/Question
It looks like our unicode literals together with recent changes in the junos-eznc library, triggered a bug. This has been raised during my tutorial at RIPE 74 (although unfortunately not recorded):
Setup
As in https://ripe74.ripe.net/presentations/18-RIPE-74-Network-automation-at-scale-up-and-running-in-60-minutes.pdf
napalm-junos version
JunOS version
Steps to Reproduce the Issue
Error Traceback
(Paste the complete traceback of the exception between quotes below)