src/dirbs/utils.py
def verify_db_role_for_job(conn, expected_role):
    """
    Function used to verify that the current DB user is in the role expected for this job.

    Arguments:
        conn: dirbs db connection object
        expected_role: name of the role to verify for the job
    Raises:
        DatabaseRoleCheckException: raises if the role is not the required role
    """
    if not is_db_user_dirbs_role(conn, expected_role):
        role = conn.get_dsn_parameters().get('user')
        raise DatabaseRoleCheckException('Current DB user {0} does not have required role: {1}. To fix this:'
                                         '\n\t1. GRANT {1} TO {0};'.format(role, expected_role))

    Function used to verify that the current DB user is in the role expected for this job.

    Arguments:
        conn: dirbs db connection object
        expected_role: name of the role to verify for the job
    Raises:
        DatabaseRoleCheckException: raises if the role is not the required role
    
Function used to verify that the current DB user is in the role expected for this job.
Function used to verify that the current DB user is in the role expected for this job .
def verify_db_role_for_job(conn, expected_role):
    if not is_db_user_dirbs_role(conn, expected_role):
        role = conn.get_dsn_parameters().get('user')
        raise DatabaseRoleCheckException('Current DB user {0} does not have required role: {1}. To fix this:'
                                         '\n\t1. GRANT {1} TO {0};'.format(role, expected_role))
def verify_db_role_for_job ( conn , expected_role ) : if not is_db_user_dirbs_role ( conn , expected_role ) : role = conn . get_dsn_parameters ( ) . get ( 'user' ) raise DatabaseRoleCheckException ( 'Current DB user {0} does not have required role: {1}. To fix this:' '\n\t1. GRANT {1} TO {0};' . format ( role , expected_role ) )
Function used to verify that the current DB user is in the role expected for this job.
Function used to verify that the current DB user is in the role expected for this job .
"""
    Function used to verify that the current DB user is in the role expected for this job.

    Arguments:
        conn: dirbs db connection object
        expected_role: name of the role to verify for the job
    Raises:
        DatabaseRoleCheckException: raises if the role is not the required role
    """
raises if the role is not the required role
raises if the role is not the required role
DatabaseRoleCheckException
conn
dirbs db connection object
dirbs db connection object
expected_role
name of the role to verify for the job
name of the role to verify for the job