mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge branch 'release_21.01' into dev
This commit is contained in:
@@ -8,6 +8,7 @@ jobs:
|
||||
name: Test
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: [3.7]
|
||||
subset: ['upload_datatype', 'extended_metadata', 'kubernetes', 'not (upload_datatype or extended_metadata or kubernetes)']
|
||||
|
||||
@@ -1310,8 +1310,6 @@ class JobWrapper(HasResourceParameters):
|
||||
# Pause any dependent jobs (and those jobs' outputs)
|
||||
for dep_job_assoc in dataset.dependent_jobs:
|
||||
self.pause(dep_job_assoc.job, "Execution of this dataset's job is paused because its input datasets are in an error state.")
|
||||
self.sa_session.add(dataset)
|
||||
self.sa_session.flush()
|
||||
job.set_final_state(job.states.ERROR)
|
||||
job.command_line = unicodify(self.command_line)
|
||||
job.info = message
|
||||
|
||||
@@ -94,7 +94,7 @@ class MetadataCollection(Mapping):
|
||||
try:
|
||||
return self.__getattr__(key)
|
||||
except Exception:
|
||||
return KeyError
|
||||
raise KeyError
|
||||
|
||||
def __len__(self):
|
||||
return len(self.spec)
|
||||
@@ -113,6 +113,7 @@ class MetadataCollection(Mapping):
|
||||
return self.spec[name].wrap(self.spec[name].default, object_session(self.parent))
|
||||
if name in self.parent._metadata:
|
||||
return self.parent._metadata[name]
|
||||
raise AttributeError
|
||||
|
||||
def __setattr__(self, name, value):
|
||||
if name == "parent":
|
||||
|
||||
@@ -1041,8 +1041,9 @@ def unicodify(value, encoding=DEFAULT_ENCODING, error='replace', strip_null=Fals
|
||||
if not isinstance(value, str):
|
||||
value = str(value, encoding, error)
|
||||
except Exception as e:
|
||||
msg = "Value '{}' could not be coerced to Unicode: {}('{}')".format(value, type(e).__name__, e)
|
||||
raise Exception(msg)
|
||||
msg = "Value '{}' could not be coerced to Unicode: {}('{}')".format(repr(value), type(e).__name__, e)
|
||||
log.exception(msg)
|
||||
raise
|
||||
if strip_null:
|
||||
return value.replace('\0', '')
|
||||
return value
|
||||
|
||||
@@ -129,7 +129,7 @@ def wrap_with_safe_string(value, no_wrap_classes=None):
|
||||
if value_mod:
|
||||
wrapped_class_name = f"{value_mod.__name__}.{wrapped_class_name}"
|
||||
wrapped_class_name = "SafeStringWrapper({}:{})".format(wrapped_class_name, ",".join(sorted(map(str, no_wrap_classes))))
|
||||
do_wrap_func_name = "__do_wrap_%s" % (wrapped_class_name)
|
||||
do_wrap_func_name = f"__do_wrap_{wrapped_class_name}"
|
||||
do_wrap_func = __do_wrap
|
||||
global_dict = globals()
|
||||
if wrapped_class_name in global_dict:
|
||||
@@ -141,7 +141,7 @@ def wrap_with_safe_string(value, no_wrap_classes=None):
|
||||
wrapped_class = type(wrapped_class_name, (safe_class, wrapped_class, ), {})
|
||||
except TypeError as e:
|
||||
# Fail-safe for when a class cannot be dynamically subclassed.
|
||||
log.warning("Unable to create dynamic subclass for %s, %s: %s", type(value), value, e)
|
||||
log.warning(f"Unable to create dynamic subclass {wrapped_class_name} for {type(value)}, {value}: {e}")
|
||||
wrapped_class = type(wrapped_class_name, (safe_class, ), {})
|
||||
if wrapped_class not in (SafeStringWrapper, CallableSafeStringWrapper):
|
||||
# Save this wrapper for reuse and pickling/copying
|
||||
|
||||
Reference in New Issue
Block a user