diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..e8c54e5 Binary files /dev/null and b/.DS_Store differ diff --git a/mvs_job.py b/mvs_job.py index f53333e..d7281e1 100755 --- a/mvs_job.py +++ b/mvs_job.py @@ -5,6 +5,10 @@ import subprocess import tempfile import os +# Force temp files into a folder inside your project (fully owned by you) +custom_temp_dir = os.path.join(os.getcwd(), "tmp") +os.makedirs(custom_temp_dir, exist_ok=True) +tempfile.tempdir = custom_temp_dir SRCLIB = "src" JCLLIB = "jcl" @@ -40,7 +44,7 @@ def upload_source(local_file, dataset_name, member_name, mvshost=MVSHOST): jcl += line.ljust(80) + "\n" jcl += "./ ENDUP\n" jcl += "/*\n" - + # Write JCL to temporary file and submit via netcat with tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.jcl') as tmpfile: tmpfile.write(jcl) @@ -50,6 +54,7 @@ def upload_source(local_file, dataset_name, member_name, mvshost=MVSHOST): # Use cat to read the file and pipe to netcat # cmd = f"cat {tmpfile_path} | nc -w3 {mvshost} {RDRPORT}" cmd = f"nc -w 5 {mvshost} {RDRPORT} < {tmpfile_path}" + print(cmd) subprocess.run(cmd, shell=True, check=True) print(f"Uploaded {local_file} to {dataset_name}({member_name})") return 0 @@ -69,7 +74,6 @@ def submit_jcl(job, mvshost="oldcomputernerd.com"): return 1 subcmd = f"nc -w 5 {mvshost} {RDRPORT} < {subjcl}" -# subcmd = f"cat {subjcl} | nc -w3 {mvshost} {RDRPORT}" try: subprocess.run(subcmd, shell=True, check=True)