From 4bad44dd58a9a789d1ca822a77b4009b5d2cd48d Mon Sep 17 00:00:00 2001 From: bleeson Date: Thu, 13 Feb 2025 08:58:36 -0800 Subject: [PATCH] customer key fix and fetch directory change. --- fetch-and-stage-orders.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch-and-stage-orders.py b/fetch-and-stage-orders.py index 0ff9eb4..535634a 100644 --- a/fetch-and-stage-orders.py +++ b/fetch-and-stage-orders.py @@ -66,11 +66,11 @@ def retrieve_x12_edi_files_shandex(): hostname=SHANDEX_SFTP_HOST, username=SHANDEX_SFTP_USERNAME, password=SHANDEX_SFTP_PASSWORD ) with ssh_client.open_sftp() as sftp_connection: - sftp_connection.chdir("/Stash/Test/FromShandex") #TODO update this to Production folder + sftp_connection.chdir("/Stash/Prod/FromShandex/Reports") #TODO update this to Production folder for filename in sftp_connection.listdir(): if filename.startswith("Stash_Tea_Order_Data"): sftp_connection.get(filename, INCOMING_DIRECTORY / filename) - new_filename = f"/Stash/Test/FromShandex/Archive/{filename}" + new_filename = f"/Stash/Prod/FromShandex/Reports/Archive/{filename}" sftp_connection.rename(filename, new_filename) def process_file(file): @@ -81,7 +81,7 @@ def process_file(file): for row in reader: if row: key_dict = { - "customerkey":row[0] + '_' + row[9], + "customerkey":row[7] + '_' + row[9], "customer_order_number":row[0], "customer_po":row[1], "Order_Type":row[2],