tools/athena/loadtoathena.py
def attach_policy_to_user(iamclient, user_name, policy_arn):
    """
    Attaches a policy to a user.
    :param user_name: The name of the user.
    :param policy_arn: The Amazon Resource Name (ARN) of the policy.
    """
    # TODO:
    # check if this is needed
    # and to be improved accordingly
    try:
        iamclient.User(user_name).attach_policy(PolicyArn=policy_arn)
        logger.info("Attached policy %s to user %s.", policy_arn, user_name)
    except ClientError:
        logger.warning("Couldn't attach policy %s to user %s.",
                       policy_arn, user_name)
        raise

    Attaches a policy to a user.
    :param user_name: The name of the user.
    :param policy_arn: The Amazon Resource Name (ARN) of the policy.
    
Attaches a policy to a user.
Attaches a policy to a user .
def attach_policy_to_user(iamclient, user_name, policy_arn):
    try:
        iamclient.User(user_name).attach_policy(PolicyArn=policy_arn)
        logger.info("Attached policy %s to user %s.", policy_arn, user_name)
    except ClientError:
        logger.warning("Couldn't attach policy %s to user %s.",
                       policy_arn, user_name)
        raise
def attach_policy_to_user ( iamclient , user_name , policy_arn ) : try : iamclient . User ( user_name ) . attach_policy ( PolicyArn = policy_arn ) logger . info ( "Attached policy %s to user %s." , policy_arn , user_name ) except ClientError : logger . warning ( "Couldn't attach policy %s to user %s." , policy_arn , user_name ) raise
Attaches a policy to a user.
Attaches a policy to a user .
"""
    Attaches a policy to a user.
    :param user_name: The name of the user.
    :param policy_arn: The Amazon Resource Name (ARN) of the policy.
    """ # TODO: # check if this is needed # and to be improved accordingly
iamclient
user_name
The name of the user.
The name of the user .
policy_arn
The Amazon Resource Name (ARN) of the policy.
The Amazon Resource Name ( ARN ) of the policy .