@log_call
def metadef_namespace_get_by_id(context, namespace_id):
 try:
  namespace = next((namespace for namespace in DATA['metadef_namespaces'] if (namespace['id'] == namespace_id)))
 except StopIteration:
  msg = (_('Metadata definition namespace not found for id=%s') % namespace_id)
  LOG.warn(msg)
  raise exception.MetadefNamespaceNotFound(msg)
 if (not _is_namespace_visible(context, namespace)):
  LOG.debug('Forbidding request, metadata definition namespace=%s is not visible.', namespace.namespace)
  emsg = (_('Forbidding request, metadata definition namespace=%s is not visible.') % namespace.namespace)
  raise exception.MetadefForbidden(emsg)
 return namespace

@ log_call def metadef_namespace_get_by_id ( context , namespace_id ) : try : namespace = next ( ( namespace for namespace in DATA [ 'metadef_namespaces' ] if ( namespace [ 'id' ] == namespace_id ) ) ) except StopIteration : msg = ( _ ( 'Metadata definition namespace not found for id=%s' ) % namespace_id ) LOG . warn ( msg ) raise exception . MetadefNamespaceNotFound ( msg ) if ( not _is_namespace_visible ( context , namespace ) ) : LOG . debug ( 'Forbidding request, metadata definition namespace=%s is not visible.' , namespace . namespace ) emsg = ( _ ( 'Forbidding request, metadata definition namespace=%s is not visible.' ) % namespace . namespace ) raise exception . MetadefForbidden ( emsg ) return namespace
get a namespace object .