Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump fideslog to v1.1.3, update usage patterns #453

Merged
merged 6 commits into from
Apr 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fidesctl/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions fidesctl/src/fidesctl/cli/commands/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions fidesctl/src/fidesctl/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

import json
import sys
from asyncio import run
from datetime import datetime, timezone
from os import getenv
from typing import Any, Callable, Dict

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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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