try job submission yet again
This commit is contained in:
parent
91c70b17cf
commit
b7a3eb522e
@ -122,19 +122,27 @@ def submit_jcl(job, mvshost="oldcomputernerd.com"):
|
||||
try:
|
||||
# Read the JCL file and send via netcat (same approach as upload_source)
|
||||
with open(subjcl, 'rb') as f:
|
||||
jcl_data = f.read()
|
||||
print(f"Submitting {len(jcl_data)} bytes of JCL to {mvshost}:{RDRPORT}")
|
||||
result = subprocess.run(
|
||||
['nc', '-w', '5', mvshost, str(RDRPORT)],
|
||||
input=f.read(),
|
||||
input=jcl_data,
|
||||
check=True,
|
||||
capture_output=True
|
||||
)
|
||||
print(f"Submitted JCL job: {job}")
|
||||
if result.stdout:
|
||||
print("JES response:", result.stdout.decode(errors='ignore').strip())
|
||||
if result.stderr:
|
||||
print("netcat stderr:", result.stderr.decode(errors='ignore').strip())
|
||||
if result.returncode != 0:
|
||||
print(f"WARNING: netcat returned non-zero exit code: {result.returncode}")
|
||||
return 1
|
||||
return 0
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"JCL submission failed: {e}")
|
||||
print(f"ERROR: JCL submission failed with exit code {e.returncode}")
|
||||
print("stderr:", e.stderr.decode(errors='ignore'))
|
||||
print("stdout:", e.stdout.decode(errors='ignore'))
|
||||
return 1
|
||||
except FileNotFoundError as e:
|
||||
print(f"Error reading JCL file: {e}")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user