src/dirbs/utils.py
def verify_db_ownership(conn):
    """
    Function used to check whether DB ownership matches what we expect.

    Arguments:
        conn: dirbs db connection object
    Raises:
        DatabaseSchemaException: if the db ownership is not correct
    """
    logger = logging.getLogger('dirbs.db')
    if query_db_ownership(conn) != 'dirbs_core_power_user':
        logger.error('Database is not owned by the dirbs_core_power_user group! Please the '
                     'following as the current DB owner (whilst logged into the database):'
                     '\n\tALTER DATABASE <database> OWNER TO dirbs_core_power_user;')
        raise DatabaseSchemaException('Incorrect database ownership!')

    Function used to check whether DB ownership matches what we expect.

    Arguments:
        conn: dirbs db connection object
    Raises:
        DatabaseSchemaException: if the db ownership is not correct
    
Function used to check whether DB ownership matches what we expect.
Function used to check whether DB ownership matches what we expect .
def verify_db_ownership(conn):
    logger = logging.getLogger('dirbs.db')
    if query_db_ownership(conn) != 'dirbs_core_power_user':
        logger.error('Database is not owned by the dirbs_core_power_user group! Please the '
                     'following as the current DB owner (whilst logged into the database):'
                     '\n\tALTER DATABASE <database> OWNER TO dirbs_core_power_user;')
        raise DatabaseSchemaException('Incorrect database ownership!')
def verify_db_ownership ( conn ) : logger = logging . getLogger ( 'dirbs.db' ) if query_db_ownership ( conn ) != 'dirbs_core_power_user' : logger . error ( 'Database is not owned by the dirbs_core_power_user group! Please the ' 'following as the current DB owner (whilst logged into the database):' '\n\tALTER DATABASE <database> OWNER TO dirbs_core_power_user;' ) raise DatabaseSchemaException ( 'Incorrect database ownership!' )
Function used to check whether DB ownership matches what we expect.
Function used to check whether DB ownership matches what we expect .
"""
    Function used to check whether DB ownership matches what we expect.

    Arguments:
        conn: dirbs db connection object
    Raises:
        DatabaseSchemaException: if the db ownership is not correct
    """
if the db ownership is not correct
if the db ownership is not correct
DatabaseSchemaException
conn
dirbs db connection object
dirbs db connection object