Skip to content

Commit

Permalink
[airos] fixed ip_interface text input
Browse files Browse the repository at this point in the history
  • Loading branch information
edoput committed Aug 29, 2017
1 parent be01dd3 commit 3ac145c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion netjsonconfig/backends/airos/converters.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from copy import deepcopy
from ipaddress import ip_interface
import six

from ...utils import get_copy
from ..base.converter import BaseConverter
Expand Down Expand Up @@ -479,7 +480,7 @@ def to_intermediate(self):
routes = self.default_routes()
original = get_copy(self.netjson, self.netjson_key, [])
for r in original:
network = ip_interface(r['destination'])
network = ip_interface(six.text_type(r['destination']))
temp = {}
temp['ip'] = str(network.ip)
temp['netmask'] = str(network.netmask)
Expand Down
3 changes: 2 additions & 1 deletion netjsonconfig/backends/airos/interface.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from ipaddress import ip_interface
from six import text_type


def autonegotiation(interface):
Expand Down Expand Up @@ -92,7 +93,7 @@ def split_cidr(address):
"""
Return the address in dict format
"""
network = ip_interface('{addr}/{mask}'.format(addr=address['address'], mask=address['mask']))
network = ip_interface(text_type('{addr}/{mask}'.format(addr=address['address'], mask=address['mask'])))
return {'ip': str(network.ip), 'netmask': str(network.netmask)}


Expand Down

0 comments on commit 3ac145c

Please sign in to comment.