def test_account_connectivity_util(account, task_name):
    """
    :param account: <AuthBook>对象
    :param task_name:
    :return:
    """
    if not check_asset_can_run_ansible(account.asset):
        return

    account.load_auth()
    try:
        raw, summary = test_user_connectivity(
            task_name=task_name, asset=account.asset,
            username=account.username, password=account.password,
            private_key=account.private_key_file
        )
    except Exception as e:
        logger.warn("Failed run adhoc {}, {}".format(task_name, e))
        return

    if summary.get('success'):
        account.set_connectivity(Connectivity.ok)
    else:
        account.set_connectivity(Connectivity.failed)