aboutsummaryrefslogtreecommitdiffstats
path: root/python/process_queue.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/process_queue.py')
-rw-r--r--python/process_queue.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/python/process_queue.py b/python/process_queue.py
index 4edc046d..7b75a946 100644
--- a/python/process_queue.py
+++ b/python/process_queue.py
@@ -362,7 +362,7 @@ def process_list(
else:
dest = get_filepath(DAILY_DIR, trade_type, fund)
if upload:
- upload_buf(buf, dest.name, fund)
+ upload_buf(buf, dest.name, fund, trade_type)
dest.parent.mkdir(exist_ok=True)
dest.write_bytes(buf)
p.delete(key)
@@ -388,7 +388,7 @@ def terminate_list(
else:
dest = get_filepath(base_dir, trade_type, fund)
if upload:
- upload_buf(buf, dest.name, fund)
+ upload_buf(buf, dest.name, fund, trade_type)
dest.parent.mkdir(exist_ok=True)
dest.write_bytes(buf)
p.delete(key)
@@ -887,7 +887,9 @@ def get_filepath(
)
-def upload_buf(buf: bytes, dest: str, fund: str = "SERCGMAST") -> None:
+def upload_buf(
+ buf: bytes, dest: str, fund: str = "SERCGMAST", trade_type="bond"
+) -> None:
if fund == "BRINKER":
sftp = SftpClient.from_creds("bbh")
sftp.put(buf, dest)
@@ -900,15 +902,18 @@ def upload_buf(buf: bytes, dest: str, fund: str = "SERCGMAST") -> None:
sftp.client.chdir("/inbound/cfe/")
sftp.put(buf, dest, False)
em = ExchangeMessage()
+ recipients = (
+ "caagtradecapture@bnymellon.com",
+ "hm-operations@bnymellon.com",
+ "caagprim@bnymellon.com",
+ "julie.picariello@bnymellon.com",
+ )
+ if trade_type in ("cds", "swaption"):
+ recipients += ("sa1futures.optionsprocessing@bnymellon.com",)
em.send_email(
"Trade file",
"",
- to_recipients=(
- "caagtradecapture@bnymellon.com",
- "hm-operations@bnymellon.com",
- "caagprim@bnymellon.com",
- "julie.picariello@bnymellon.com",
- ),
+ to_recipients=recipients,
cc_recipients=("bowdoin-ops@lmcg.com",),
attach=(FileAttachment(name=dest, content=buf),),
)