Skip to content

Commit

Permalink
Merge "[DM]: Fix for supporting flat ip subnets" into R3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Dec 10, 2016
2 parents db38148 + f51be9b commit 3f0bd05
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
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 3f0bd05

Please sign in to comment.