def nova_to_osvif_vif(vif):
 LOG.debug('Converting VIF %s', vif)
 funcname = ('_nova_to_osvif_vif_' + vif['type'].replace('.', '_'))
 func = getattr(sys.modules[__name__], funcname, None)
 if (not func):
  raise exception.NovaException(("Unsupported VIF type %(type)s convert '%(func)s'" % {'type': vif['type'], 'func': funcname}))
 try:
  vifobj = func(vif)
  LOG.debug('Converted object %s', vifobj)
  return vifobj
 except NotImplementedError:
  LOG.debug('No conversion for VIF type %s yet', vif['type'])
  return None

def nova_to_osvif_vif ( vif ) : LOG . debug ( 'Converting VIF %s' , vif ) funcname = ( '_nova_to_osvif_vif_' + vif [ 'type' ] . replace ( '.' , '_' ) ) func = getattr ( sys . modules [ __name__ ] , funcname , None ) if ( not func ) : raise exception . NovaException ( ( "Unsupported VIF type %(type)s convert '%(func)s'" % { 'type' : vif [ 'type' ] , 'func' : funcname } ) ) try : vifobj = func ( vif ) LOG . debug ( 'Converted object %s' , vifobj ) return vifobj except NotImplementedError : LOG . debug ( 'No conversion for VIF type %s yet' , vif [ 'type' ] ) return None
convert a nova vif model to an os-vif object .