Skip to content

Commit 2283d6d

Browse files
committed
[openvpn] Convert node properties to integer
This fixes an unexpected JSON serialization error on python 2
1 parent f904c6c commit 2283d6d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

netdiff/parsers/openvpn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ def parse(self, data):
4141
client_properties = {
4242
'label': client.common_name,
4343
'real_address': str(client.real_address.host),
44-
'port': client.real_address.port,
44+
'port': int(client.real_address.port),
4545
'connected_since': client.connected_since.strftime('%Y-%m-%dT%H:%M:%SZ'),
46-
'bytes_received': client.bytes_received,
47-
'bytes_sent': client.bytes_sent
46+
'bytes_received': int(client.bytes_received),
47+
'bytes_sent': int(client.bytes_sent)
4848
}
4949
local_addresses = [
5050
str(route.virtual_address)

0 commit comments

Comments
 (0)