Skip to content

Instantly share code, notes, and snippets.

@roaet
Created February 12, 2013 19:34
Show Gist options
  • Save roaet/4772664 to your computer and use it in GitHub Desktop.
Save roaet/4772664 to your computer and use it in GitHub Desktop.
res = {'id': subnet.get('id'),
'name': subnet.get('name'),
'tenant_id': subnet.get('tenant_id'),
'network_id': subnet.get('network_id'),
'ip_version': subnet.get('ip_version'),
'cidr': subnet.get('_cidr'),
'enable_dhcp': subnet.get('enable_dhcp'),}
#'dns_nameservers': [dns.get('address')
# for dns in subnet.get('dns_nameservers')],
#'gateway_ip': subnet.get('gateway_ip'),
#'host_routes': [{'destination': route.get('destination'),
# 'nexthop': route.get('nexthop')}
# for route in subnet.get('routes', [])],
#'shared': subnet.get('shared')
#}
#'allocation_pools': [{'start': pool.get('first_ip'),
# 'end': pool.get('last_ip')}
# for pool in subnet.get('allocation_pools')],
#}
#if subnet.get('gateway_ip'):
# res['gateway_ip'] = subnet.get('gateway_ip')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment