Skip to content

Commit 3ac145c

Browse files
committed
[airos] fixed ip_interface text input
1 parent be01dd3 commit 3ac145c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

netjsonconfig/backends/airos/converters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from copy import deepcopy
22
from ipaddress import ip_interface
3+
import six
34

45
from ...utils import get_copy
56
from ..base.converter import BaseConverter
@@ -479,7 +480,7 @@ def to_intermediate(self):
479480
routes = self.default_routes()
480481
original = get_copy(self.netjson, self.netjson_key, [])
481482
for r in original:
482-
network = ip_interface(r['destination'])
483+
network = ip_interface(six.text_type(r['destination']))
483484
temp = {}
484485
temp['ip'] = str(network.ip)
485486
temp['netmask'] = str(network.netmask)

netjsonconfig/backends/airos/interface.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from ipaddress import ip_interface
2+
from six import text_type
23

34

45
def autonegotiation(interface):
@@ -92,7 +93,7 @@ def split_cidr(address):
9293
"""
9394
Return the address in dict format
9495
"""
95-
network = ip_interface('{addr}/{mask}'.format(addr=address['address'], mask=address['mask']))
96+
network = ip_interface(text_type('{addr}/{mask}'.format(addr=address['address'], mask=address['mask'])))
9697
return {'ip': str(network.ip), 'netmask': str(network.netmask)}
9798

9899

0 commit comments

Comments
 (0)