Log more information on command execution

So we can tell *why* it failed on not just that it failed.
This commit is contained in:
E Rasche
2017-09-28 08:07:59 +00:00
parent 9a0511e883
commit c421f29d85
@@ -1,3 +1,4 @@
import logging
import os
import subprocess
import time
@@ -8,6 +9,7 @@ from six import text_type
from galaxy.util import unicodify
log = logging.getLogger(__name__)
DEFAULT_SHELL = '/bin/bash'
DEFAULT_JOB_FILE_TEMPLATE = Template(
@@ -131,11 +133,14 @@ def _handle_script_integrity(path, config):
# These have occurred both in Docker containers and on EC2 clusters
# under high load.
subprocess.check_call(INTEGRITY_SYNC_COMMAND)
except Exception:
pass
except Exception as e:
log.debug("Error syncing the filesystem %s", e)
time.sleep(sleep_amt)
except Exception:
pass
except OSError as ose:
log.debug("Script not available yet %s", ose)
except Exception as exc:
log.debug("Script not available yet %s", exc)
if not script_integrity_verified:
raise Exception("Failed to write job script, could not verify job script integrity.")