def _nova_to_osvif_subnet(subnet):
 dnsaddrs = [ip['address'] for ip in subnet['dns']]
 obj = objects.subnet.Subnet(dns=dnsaddrs, ips=_nova_to_osvif_ips(subnet['ips']), routes=_nova_to_osvif_routes(subnet['routes']))
 if (subnet['cidr'] is not None):
  obj.cidr = subnet['cidr']
 if ((subnet['gateway'] is not None) and (subnet['gateway']['address'] is not None)):
  obj.gateway = subnet['gateway']['address']
 return obj

def _nova_to_osvif_subnet ( subnet ) : dnsaddrs = [ ip [ 'address' ] for ip in subnet [ 'dns' ] ] obj = objects . subnet . Subnet ( dns = dnsaddrs , ips = _nova_to_osvif_ips ( subnet [ 'ips' ] ) , routes = _nova_to_osvif_routes ( subnet [ 'routes' ] ) ) if ( subnet [ 'cidr' ] is not None ) : obj . cidr = subnet [ 'cidr' ] if ( ( subnet [ 'gateway' ] is not None ) and ( subnet [ 'gateway' ] [ 'address' ] is not None ) ) : obj . gateway = subnet [ 'gateway' ] [ 'address' ] return obj
convert nova subnet object into os_vif object .