def file_based()

in src/es_pii_tool/commands/from_yaml.py [0:0]


def file_based(ctx, dry_run, redactions_file, tracking_index):
    """Redact from YAML config file"""
    try:
        client = get_client(configdict=ctx.obj['configdict'])
    except Exception as exc:
        logger.critical('Error attempting to get client connection: %s', exc.args[0])
        raise FatalError(
            'Unable to establish connection to Elasticsearch!', exc
        ) from exc
    try:
        main = PiiTool(
            client, tracking_index, redaction_file=redactions_file, dry_run=dry_run
        )
        main.run()
    except Exception as exc:
        logger.error('Exception: %s', exc)
        raise exc