Detach a managed policy to a user.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_iam.detach_user_policy mypolicy myuser

def detach_user_policy(policy_name, user_name,
                  region=None, key=None, keyid=None, profile=None):
    '''
    Detach a managed policy to a user.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_iam.detach_user_policy mypolicy myuser
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    policy_arn = _get_policy_arn(policy_name, region, key, keyid, profile)
    try:
        conn.detach_user_policy(policy_arn, user_name)
        log.info('Detached %s policy from IAM user %s.', policy_name, user_name)
    except boto.exception.BotoServerError as e:
        log.debug(e)
        log.error('Failed to detach %s policy from IAM user %s.', policy_name, user_name)
        return False
    return True