napalm-automation / napalm-junos

Apache License 2.0
22 stars 42 forks source link

fix - Inf conversion to float in get_optics() #204

Closed ckishimo closed 6 years ago

ckishimo commented 6 years ago

I was getting the following error while using the get_optics() method File "/home/devel/napalm-junos/napalm-junos/napalm_junos/junos.py", line 1785, in get_optics [None, C.OPTICS_NULL_LEVEL] ValueError: could not convert string to float: - Inf

The contents of the optics_items list returns: [('xe-0/0/0', [('output_power', '-1.82'), ('laser_bias_current', '38.282'), ('input_power', '- Inf')]), ('et-0/0/48', [('output_power', None), ('laser_bias_current', Non e), ('input_power', None)]), ('et-0/0/49', [('output_power', None), ('laser_bias_current', None), ('input_power', None)]), ('et-0/0/50', [('output_power', None), ('laser _bias_current', None), ('input_power', None)]), ('et-0/0/51', [('output_power', None), ('laser_bias_current', None), ('input_power', None)])]

Not sure if the change needs to be applied in output_power (line 1795) and laser_bias_current (lihe1805)

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 78.759% when pulling a332af9079795c2e55290f76878e2001eae5089f on ckishimo:develop into 3a73f1b8519a846c960361784ce0295b1c354b3d on napalm-automation:develop.

ckishimo commented 6 years ago

Oops ! Sorry I see now there was an issue already open for that... closing