Skip to content

Commit ae39aad

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

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

netjsonconfig/backends/airos/converters.py

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

4+
import six
5+
46
from ...utils import get_copy
57
from ..base.converter import BaseConverter
68
from .aaa import bridge_devname, profile_from_interface, status_from_interface
@@ -479,7 +481,7 @@ def to_intermediate(self):
479481
routes = self.default_routes()
480482
original = get_copy(self.netjson, self.netjson_key, [])
481483
for r in original:
482-
network = ip_interface(r['destination'])
484+
network = ip_interface(six.text_type(r['destination']))
483485
temp = {}
484486
temp['ip'] = str(network.ip)
485487
temp['netmask'] = str(network.netmask)

netjsonconfig/backends/airos/interface.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from ipaddress import ip_interface
22

3+
from six import text_type
4+
35

46
def autonegotiation(interface):
57
"""
@@ -92,7 +94,7 @@ def split_cidr(address):
9294
"""
9395
Return the address in dict format
9496
"""
95-
network = ip_interface('{addr}/{mask}'.format(addr=address['address'], mask=address['mask']))
97+
network = ip_interface(text_type('{addr}/{mask}'.format(addr=address['address'], mask=address['mask'])))
9698
return {'ip': str(network.ip), 'netmask': str(network.netmask)}
9799

98100

0 commit comments

Comments
 (0)