def _get_default_route(version, subnet):
 if (subnet.get('gateway') and subnet['gateway'].get('address')):
  gateway = subnet['gateway']['address']
 else:
  return []
 if (version == 4):
  return [{'network': '0.0.0.0', 'netmask': '0.0.0.0', 'gateway': gateway}]
 elif (version == 6):
  return [{'network': '::', 'netmask': '::', 'gateway': gateway}]

def _get_default_route ( version , subnet ) : if ( subnet . get ( 'gateway' ) and subnet [ 'gateway' ] . get ( 'address' ) ) : gateway = subnet [ 'gateway' ] [ 'address' ] else : return [ ] if ( version == 4 ) : return [ { 'network' : '0.0.0.0' , 'netmask' : '0.0.0.0' , 'gateway' : gateway } ] elif ( version == 6 ) : return [ { 'network' : '::' , 'netmask' : '::' , 'gateway' : gateway } ]
get a default route for a network .