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.'
    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.
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))