try to track jobs from reader responses

This commit is contained in:
Gregory Gauthier 2026-02-06 12:32:58 +00:00
parent b23e0f69bb
commit 894ffd6bba

View File

@ -64,13 +64,15 @@ def upload_source(local_file, dataset_name, member_name, mvshost=MVSHOST):
tmpfile_path = tmpfile.name tmpfile_path = tmpfile.name
try: try:
with open(tmpfile_path, 'rb') as f: with open(tmpfile_path, 'rb') as f:
subprocess.run( result = subprocess.run(
['nc', '-w', '5', mvshost, str(RDRPORT)], ['nc', '-w', '5', mvshost, str(RDRPORT)],
input=f.read(), input=f.read(),
check=True, check=True,
capture_output=True capture_output=True
) )
print(f"Uploaded {local_file} to {dataset_name}({member_name})") print(f"Uploaded {local_file} to {dataset_name}({member_name})")
if result.stdout:
print("JES response:", result.stdout.decode(errors='ignore').strip())
return 0 return 0
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
print(f"Upload failed: {e}") print(f"Upload failed: {e}")
@ -92,8 +94,10 @@ def submit_jcl(job, mvshost="oldcomputernerd.com"):
subcmd = f"nc -w 5 {mvshost} {RDRPORT} < {subjcl}" subcmd = f"nc -w 5 {mvshost} {RDRPORT} < {subjcl}"
try: try:
subprocess.run(subcmd, shell=True, check=True) result = subprocess.run(subcmd, shell=True, check=True, capture_output=True)
print(f"Submitted JCL job: {job}") print(f"Submitted JCL job: {job}")
if result.stdout:
print("JES response:", result.stdout.decode(errors='ignore').strip())
return 0 return 0
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
print(f"JCL submission failed: {e}") print(f"JCL submission failed: {e}")