Skip to content

Commit

Permalink
[DM]: Fix for supporting flat ip subnets
Browse files Browse the repository at this point in the history
Change-Id: Idcdf3f005b8018aa4011b18610d427ff84aa9777
Closes-Bug: #1648655
  • Loading branch information
sbalineni committed Dec 9, 2016
1 parent ae5960d commit f51be9b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/config/device-manager/device_manager/dm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ def get_network_gateways(ipam_refs=[]):
gateways = {}
for ipam_ref in ipam_refs or []:
for subnet in ipam_ref['attr'].get('ipam_subnets', []):
prefix = subnet['subnet']['ip_prefix']
prefix_len = subnet['subnet']['ip_prefix_len']
prefix = '0.0.0.0'
prefix_len = 0
if 'subnet' in subnet:
prefix = subnet['subnet']['ip_prefix']
prefix_len = subnet['subnet']['ip_prefix_len']
gateways[prefix + '/' + str(prefix_len)] = \
{"default_gateway": subnet.get('default_gateway', ''),
"subnet_uuid": subnet.get('subnet_uuid')}
Expand Down

0 comments on commit f51be9b

Please sign in to comment.