use click.echo

This commit is contained in:
Kenneth Kehl
2024-07-23 07:47:35 -07:00
parent 7600699e23
commit 86c9065a44
2 changed files with 3 additions and 5 deletions

View File

@@ -590,7 +590,7 @@ def process_row_from_job(job_id, job_row_number):
@notify_command(name="download-csv-file-by-name") @notify_command(name="download-csv-file-by-name")
@click.option("-f", "--csv_filename", required=True, help="csv file name") @click.argument("csv_filename")
def download_csv_file_by_name(csv_filename): def download_csv_file_by_name(csv_filename):
bucket_name = current_app.config["CSV_UPLOAD_BUCKET"]["bucket"] bucket_name = current_app.config["CSV_UPLOAD_BUCKET"]["bucket"]
@@ -598,9 +598,7 @@ def download_csv_file_by_name(csv_filename):
secret = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"] secret = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"]
region = current_app.config["CSV_UPLOAD_BUCKET"]["region"] region = current_app.config["CSV_UPLOAD_BUCKET"]["region"]
content = s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region) content = s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region)
# We want it all to get logged in one line click.echo(content)
content = content.replace("\n", "|")
print(content)
@notify_command(name="populate-annual-billing-with-the-previous-years-allowance") @notify_command(name="populate-annual-billing-with-the-previous-years-allowance")

View File

@@ -1349,7 +1349,7 @@ cf run-task notify-api-production --command "flask command download-csv-file-by-
locally, just do: locally, just do:
``` ```
poetry run flask command download-csv-file-by-name -f <file location in admin logs> poetry run flask command download-csv-file-by-name <file location in admin logs>
``` ```
## Debug steps ## Debug steps