adding debug messages
This commit is contained in:
parent
b39c2a9d9a
commit
51b702d7e7
13
poll_job.py
13
poll_job.py
@ -8,11 +8,11 @@ import subprocess
|
|||||||
import requests
|
import requests
|
||||||
from requests.auth import HTTPBasicAuth
|
from requests.auth import HTTPBasicAuth
|
||||||
|
|
||||||
CONSOLE_URL = os.environ.get("MVS_CONSOLE_URL")
|
CONSOLE_URL = os.environ.get("MVS_CONSOLE_URL", "http://oldcomputernerd.com:8038/cgi-bin/tasks/syslog")
|
||||||
CONSOLE_USER = os.environ.get("MVS_CONSOLE_USER")
|
CONSOLE_USER = os.environ.get("MVS_CONSOLE_USER", "gmgauthier")
|
||||||
CONSOLE_PASS = os.environ.get("MVS_CONSOLE_PASSWORD")
|
CONSOLE_PASS = os.environ.get("MVS_CONSOLE_PASSWORD")
|
||||||
LINODE_HOST = os.environ.get("LINODE_SSH_HOST")
|
LINODE_HOST = os.environ.get("LINODE_SSH_HOST", "gmgauthier@socrates")
|
||||||
LINODE_PRINTOUT_DIR = os.environ.get("LINODE_PRINTOUT_DIR")
|
LINODE_PRINTOUT_DIR = os.environ.get("LINODE_PRINTOUT_DIR", "/home/gmgauthier/printouts")
|
||||||
|
|
||||||
def get_syslog():
|
def get_syslog():
|
||||||
"""Fetch the Hercules syslog via HTTP"""
|
"""Fetch the Hercules syslog via HTTP"""
|
||||||
@ -89,7 +89,7 @@ def retrieve_pdf(source_path, local_filename, is_local=False):
|
|||||||
"""Retrieve PDF either locally (copy) or remotely (SCP)"""
|
"""Retrieve PDF either locally (copy) or remotely (SCP)"""
|
||||||
try:
|
try:
|
||||||
if is_local:
|
if is_local:
|
||||||
# Local copy from mounted volume
|
# Local copy from a mounted volume
|
||||||
import shutil
|
import shutil
|
||||||
shutil.copy2(source_path, local_filename)
|
shutil.copy2(source_path, local_filename)
|
||||||
print(f"Copied: {local_filename}")
|
print(f"Copied: {local_filename}")
|
||||||
@ -111,6 +111,9 @@ def poll_for_job(jn, to=300, poll_interval=5):
|
|||||||
|
|
||||||
print(f"Polling for job: {jobname_upper}")
|
print(f"Polling for job: {jobname_upper}")
|
||||||
print(f"Timeout: {to}s, Poll interval: {poll_interval}s")
|
print(f"Timeout: {to}s, Poll interval: {poll_interval}s")
|
||||||
|
print(f"Console URL: {CONSOLE_URL}")
|
||||||
|
print(f"Console User: {CONSOLE_USER}")
|
||||||
|
print(f"Console Pass: {'***' if CONSOLE_PASS else 'NOT SET'}")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
# Phase 1: Find a job number
|
# Phase 1: Find a job number
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user