def verify_db_roles_installed(conn):
    'Function used to verify whether roles have been installed in the DB.'
    logger = logging.getLogger('dirbs.db')
    with conn.cursor() as cursor:
        cursor.execute("SELECT 1 AS res FROM pg_roles WHERE rolname = 'dirbs_core_power_user'")
        if (cursor.fetchone() is None):
            logger.error("DIRBS Core roles have not been installed - run 'dirbs-db install_roles' before running 'dirbs-db install'")
            raise DatabaseSchemaException('DIRBS Core database roles have not been installed')
Function used to verify whether roles have been installed in the DB.
def verify_db_roles_installed(conn):
    
    logger = logging.getLogger('dirbs.db')
    with conn.cursor() as cursor:
        cursor.execute("SELECT 1 AS res FROM pg_roles WHERE rolname = 'dirbs_core_power_user'")
        if (cursor.fetchone() is None):
            logger.error("DIRBS Core roles have not been installed - run 'dirbs-db install_roles' before running 'dirbs-db install'")
            raise DatabaseSchemaException('DIRBS Core database roles have not been installed')