def namedb_namespace_insert( cur, input_namespace_rec ):
    """
    Add a namespace to the database,
    if it doesn't exist already.
    It must be a *revealed* namespace, not a ready namespace
    (to mark a namespace as ready, you should use the namedb_apply_operation()
    method).
    """

    namespace_rec = copy.deepcopy( input_namespace_rec )

    namedb_namespace_fields_check( namespace_rec )

    try:
        query, values = namedb_insert_prepare( cur, namespace_rec, "namespaces" )
    except Exception, e:
        log.exception(e)
        log.error("FATAL: Failed to insert revealed namespace '%s'" % namespace_rec['namespace_id']) 
        os.abort()

    namedb_query_execute( cur, query, values )
    return True
def namedb_namespace_insert ( cur , input_namespace_rec ) : namespace_rec = copy . deepcopy ( input_namespace_rec ) namedb_namespace_fields_check ( namespace_rec ) try : query , values = namedb_insert_prepare ( cur , namespace_rec , "namespaces" ) except Exception , e : log . exception ( e ) log . error ( "FATAL: Failed to insert revealed namespace '%s'" % namespace_rec [ 'namespace_id' ] ) os . abort ( ) namedb_query_execute ( cur , query , values ) return True
Add a namespace to the database,
    if it doesn't exist already.
    It must be a *revealed* namespace, not a ready namespace
    (to mark a namespace as ready, you should use the namedb_apply_operation()
    method).