diff --git a/fidesctl/requirements.txt b/fidesctl/requirements.txt index c19aee5fd5..feb74082f7 100644 --- a/fidesctl/requirements.txt +++ b/fidesctl/requirements.txt @@ -3,7 +3,7 @@ click>=7.1.2,<8 colorama>=0.4.3 cryptography>=36 deepdiff==5.5 -fideslog==1.0.1 +fideslog==1.1.3 loguru>=0.5,<0.6 openpyxl==3.0.9 pandas==1.4 diff --git a/fidesctl/src/fidesctl/cli/commands/util.py b/fidesctl/src/fidesctl/cli/commands/util.py index f9d01e8ec8..805ba711fc 100644 --- a/fidesctl/src/fidesctl/cli/commands/util.py +++ b/fidesctl/src/fidesctl/cli/commands/util.py @@ -2,9 +2,10 @@ import os import click -from fideslog.sdk.python.utils import OPT_OUT_COPY import toml +from fideslog.sdk.python.utils import OPT_OUT_COPY, OPT_OUT_PROMPT + import fidesctl from fidesctl.cli.utils import check_server, with_analytics from fidesctl.core.utils import echo_green, echo_red @@ -62,7 +63,8 @@ def init(ctx: click.Context, fides_directory_location: str) -> None: config_docs_url = "https://ethyca.github.io/fides/installation/configuration/" config_message = f"""Created a config file at '{config_path}'. To learn more, see: {config_docs_url}""" - config.user.analytics_opt_out = bool(input(OPT_OUT_COPY).lower() == "n") + click.echo(OPT_OUT_COPY) + config.user.analytics_opt_out = bool(input(OPT_OUT_PROMPT).lower() == "n") with open(config_path, "w") as config_file: config_dict = config.dict(include=included_values) toml.dump(config_dict, config_file) diff --git a/fidesctl/src/fidesctl/cli/utils.py b/fidesctl/src/fidesctl/cli/utils.py index 810646cb06..1359fa665b 100644 --- a/fidesctl/src/fidesctl/cli/utils.py +++ b/fidesctl/src/fidesctl/cli/utils.py @@ -2,7 +2,6 @@ import json import sys -from asyncio import run from datetime import datetime, timezone from os import getenv from typing import Any, Callable, Dict @@ -10,8 +9,8 @@ import click import requests from fideslog.sdk.python.event import AnalyticsEvent -from fideslog.sdk.python.exceptions import AnalyticsException -from fideslog.sdk.python.utils import OPT_OUT_COPY +from fideslog.sdk.python.exceptions import AnalyticsError +from fideslog.sdk.python.utils import OPT_OUT_COPY, OPT_OUT_PROMPT from fidesctl.core import api as _api from fidesctl.core.config.utils import get_config_from_file, update_config_file @@ -74,8 +73,9 @@ def check_and_update_analytics_config(ctx: click.Context, config_path: str) -> N config_updates: Dict[str, Dict] = {} if ctx.obj["CONFIG"].user.analytics_opt_out is None: + click.echo(OPT_OUT_COPY) ctx.obj["CONFIG"].user.analytics_opt_out = bool( - input(OPT_OUT_COPY).lower() == "n" + input(OPT_OUT_PROMPT).lower() == "n" ) config_updates.update( @@ -138,6 +138,6 @@ def with_analytics(ctx: click.Context, command_handler: Callable, **kwargs: Dict ) try: - run(ctx.meta["ANALYTICS_CLIENT"].send(event)) - except AnalyticsException: + ctx.meta["ANALYTICS_CLIENT"].send(event) + except AnalyticsError: pass # cli analytics should fail silently