Skip to content

Commit

Permalink
Fix sniff_compressed_dynamic_datatypes_default config option not prop…
Browse files Browse the repository at this point in the history
…agating to upload tool.

Resolving the default when unspecified in the XML before writing out datatype confs fixes this. This makes this option always explicit in the datatypes conf that is shared with the upload tool.
  • Loading branch information
jmchilton committed May 10, 2018
1 parent 8a58711 commit 2d103a0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/galaxy/datatypes/registry.py
Expand Up @@ -140,6 +140,11 @@ def __import_module(full_path, datatype_module, datatype_class_name):
type_extension = elem.get('type_extension', None)
auto_compressed_types = galaxy.util.listify(elem.get('auto_compressed_types', ''))
sniff_compressed_types = galaxy.util.string_as_bool_or_none(elem.get("sniff_compressed_types", "None"))
if sniff_compressed_types is None:
sniff_compressed_types = getattr(self.config, "sniff_compressed_dynamic_datatypes_default", True)
# Make sure this is set in the elems we write out so the config option is passed ot the upload
# tool which does not have a config object.
elem.set("sniff_compressed_types", str(sniff_compressed_types))
mimetype = elem.get('mimetype', None)
display_in_upload = galaxy.util.string_as_bool(elem.get('display_in_upload', False))
# If make_subclass is True, it does not necessarily imply that we are subclassing a datatype that is contained
Expand Down Expand Up @@ -321,9 +326,6 @@ def __import_module(full_path, datatype_module, datatype_class_name):
else:
raise Exception("Unknown auto compression type [%s]" % auto_compressed_type)
attributes["file_ext"] = compressed_extension
if sniff_compressed_types is None:
sniff_compressed_types = getattr(self.config, "sniff_compressed_dynamic_datatypes_default", True)

attributes["uncompressed_datatype_instance"] = datatype_instance
compressed_datatype_class = type(auto_compressed_type_name, (datatype_class, dynamic_parent, ), attributes)
if edam_format:
Expand Down

0 comments on commit 2d103a0

Please sign in to comment.