napalm-automation / napalm-junos

Apache License 2.0
22 stars 42 forks source link

`get_optics` is broken #104

Closed mirceaulinic closed 7 years ago

mirceaulinic commented 7 years ago

Error Traceback

(Paste the complete traceback of the exception between quotes below)

>>> j.get_optics()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/state/home/mircea/napalm/local/lib/python2.7/site-packages/napalm_junos/junos.py", line 1421, in get_optics
    if optics['input_power'] != '- Inf'
TypeError: float() argument must be a string or a number

napalm-junos version

(Paste verbatim output from pip freeze | grep napalm-junos between quotes below)

0.6.0

JunOS version

(Paste verbatim output from show version and haiku between quotes below)

14.2R6.5
mirceaulinic commented 7 years ago

Same on 13.3R6.5

pkleanthous-zz commented 7 years ago

Tested it with

napalm-junos==0.6.0
root> show version and haiku    
Model: vsrx
Junos: 15.1X49-D60.7
JUNOS Software Release [15.1X49-D60.7]

        Another day dies
        More joy than I can fathom
        Yet more tomorrow

It returns an empty dict

In [9]: print device.get_optics()
{}
mirceaulinic commented 7 years ago

Yeah... this might be because a vSRX does not have any physical interfaces :)