X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/178a1c6d587f4e5edf1be08261e00af90169c702..96f176d43e03de4ba9dbb8a446a9339cb5032cec:/sdk/cwl/arvados_cwl/executor.py diff --git a/sdk/cwl/arvados_cwl/executor.py b/sdk/cwl/arvados_cwl/executor.py index aa19633d8c..f04f304760 100644 --- a/sdk/cwl/arvados_cwl/executor.py +++ b/sdk/cwl/arvados_cwl/executor.py @@ -18,6 +18,7 @@ import json import re from functools import partial import time +import urllib from cwltool.errors import WorkflowException import cwltool.workflow @@ -261,45 +262,22 @@ The 'jobs' API is no longer supported. return runtime_status = current.get('runtime_status', {}) # In case of status being an error, only report the first one. - if kind == 'error': - if not runtime_status.get('error'): - runtime_status.update({ - 'error': message - }) - if detail is not None: - runtime_status.update({ - 'errorDetail': detail - }) - # Further errors are only mentioned as a count. - else: - # Get anything before an optional 'and N more' string. - try: - error_msg = re.match( - r'^(.*?)(?=\s*\(and \d+ more\)|$)', runtime_status.get('error')).groups()[0] - more_failures = re.match( - r'.*\(and (\d+) more\)', runtime_status.get('error')) - except TypeError: - # Ignore tests stubbing errors - return - if more_failures: - failure_qty = int(more_failures.groups()[0]) - runtime_status.update({ - 'error': "%s (and %d more)" % (error_msg, failure_qty+1) - }) - else: - runtime_status.update({ - 'error': "%s (and 1 more)" % error_msg - }) - elif kind in ['warning', 'activity']: - # Record the last warning/activity status without regard of - # previous occurences. + if kind in ('error', 'warning', 'activity'): + updatemessage = runtime_status.get(kind, "") + if updatemessage: + updatemessage += "\n" + updatemessage += message + + # Subsequent messages tacked on as detail + updatedetail = runtime_status.get(kind+'Detail', "") + if updatedetail: + updatedetail += "\n" + if detail: + updatedetail += message + "\n" + detail runtime_status.update({ - kind: message + kind: updatemessage, + kind+'Detail': updatedetail, }) - if detail is not None: - runtime_status.update({ - kind+"Detail": detail - }) else: # Ignore any other status kind return @@ -450,7 +428,7 @@ The 'jobs' API is no longer supported. srccollection = sp[0][5:] try: reader = self.collection_cache.get(srccollection) - srcpath = "/".join(sp[1:]) if len(sp) > 1 else "." + srcpath = urllib.parse.unquote("/".join(sp[1:]) if len(sp) > 1 else ".") final.copy(srcpath, v.target, source_collection=reader, overwrite=False) except arvados.errors.ArgumentError as e: logger.error("Creating CollectionReader for '%s' '%s': %s", k, v, e) @@ -577,8 +555,8 @@ The 'jobs' API is no longer supported. loadingContext = self.loadingContext.copy() loadingContext.do_validate = False - loadingContext.do_update = False if submitting: + loadingContext.do_update = False # Document may have been auto-updated. Reload the original # document with updating disabled because we want to # submit the document with its original CWL version, not