Skip to content
This repository was archived by the owner on Feb 10, 2018. It is now read-only.

Commit

Permalink
fixes #176 get_facts uptime against patch in pyeznc 2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
lampwins committed Sep 13, 2017
1 parent 3a73f1b commit 1da6bc2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
David Barroso <dbarrosop@dravetech.com>
Elisa Jasinska <elisa@bigwaveit.org>
John Anderson <lampwins@gmail.com>
6 changes: 2 additions & 4 deletions napalm_junos/junos.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ def get_facts(self):
"""Return facts of the device."""
output = self.device.facts

uptime = '0'
if 'RE0' in output:
uptime = output['RE0']['up_time']
uptime = self.device.uptime or -1

interfaces = junos_views.junos_iface_table(self.device)
interfaces.get()
Expand All @@ -271,7 +269,7 @@ def get_facts(self):
'os_version': py23_compat.text_type(output['version']),
'hostname': py23_compat.text_type(output['hostname']),
'fqdn': py23_compat.text_type(output['fqdn']),
'uptime': string_parsers.convert_uptime_string_seconds(uptime),
'uptime': uptime,
'interface_list': interface_list
}

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
napalm-base>=0.24.1
junos-eznc>=2.1.3
junos-eznc>=2.1.5

0 comments on commit 1da6bc2

Please sign in to comment.