merge from main

This commit is contained in:
Kenneth Kehl
2024-08-09 12:14:19 -07:00
9 changed files with 74 additions and 31 deletions

View File

@@ -592,14 +592,18 @@ def process_row_from_job(job_id, job_row_number):
@notify_command(name="download-csv-file-by-name")
@click.option("-f", "--csv_filename", required=True, help="csv file name")
@click.option("-f", "--csv_filename", required=True, help="S3 file location")
def download_csv_file_by_name(csv_filename):
# poetry run flask command download-csv-file-by-name -f <s3 file location>
# cf run-task notify-api-production --command "flask command download-csv-file-by-name -f <s3 location>"
bucket_name = current_app.config["CSV_UPLOAD_BUCKET"]["bucket"]
access_key = current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"]
secret = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"]
region = current_app.config["CSV_UPLOAD_BUCKET"]["region"]
print(s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region))
s3.download_from_s3(
bucket_name, csv_filename, "download.csv", access_key, secret, region
)
@notify_command(name="dump-sms-senders")
@@ -607,7 +611,7 @@ def download_csv_file_by_name(csv_filename):
def dump_sms_senders(service_name):
# poetry run flask command dump-sms-senders MyServiceName
# cf run-task notify-api-production --command "flask command dump-sms-senders MyServiceName"
# cf run-task notify-api-production --command "flask command dump-sms-senders <MyServiceName>"
services = get_services_by_partial_name(service_name)
if len(services) > 1:
raise ValueError(