From 6b7678f3e020ba370c6eef3943d7128cc4dccbe5 Mon Sep 17 00:00:00 2001 From: Loke Berne Date: Tue, 1 Dec 2015 16:24:56 +0100 Subject: [PATCH] Fixed type for counters --- napalm/fortios.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/napalm/fortios.py b/napalm/fortios.py index dc03eaf..61d38f2 100644 --- a/napalm/fortios.py +++ b/napalm/fortios.py @@ -257,18 +257,18 @@ class FortiOSDriver(NetworkDriver): elif (data[1].startswith('RX packets') or data[1].startswith('TX packets')) and if_name: if_data = data[1].split(' ') direction = if_data[0].lower() - interface_counters[if_name][direction + '_unicast_packets'] = if_data[1].split(':')[1] - interface_counters[if_name][direction + '_errors'] = if_data[2].split(':')[1] - interface_counters[if_name][direction + '_discards'] = if_data[2].split(':')[1] + interface_counters[if_name][direction + '_unicast_packets'] = int(if_data[1].split(':')[1]) + interface_counters[if_name][direction + '_errors'] = int(if_data[2].split(':')[1]) + interface_counters[if_name][direction + '_discards'] = int(if_data[2].split(':')[1]) interface_counters[if_name][direction + '_multicast_packets'] = -1 interface_counters[if_name][direction + '_broadcast_packets'] = -1 elif data[1].startswith('RX bytes'): if_data = data[1].split(' ') - interface_counters[if_name]['rx_octets'] = if_data[1].split(':')[1] + interface_counters[if_name]['rx_octets'] = int(if_data[1].split(':')[1]) try: - interface_counters[if_name]['tx_octets'] = if_data[6].split(':')[1] + interface_counters[if_name]['tx_octets'] = int(if_data[6].split(':')[1]) except IndexError: - interface_counters[if_name]['tx_octets'] = if_data[7].split(':')[1] + interface_counters[if_name]['tx_octets'] = int(if_data[7].split(':')[1]) return interface_counters def get_lldp_neighbors(self):