Fix failing API tests for explicit collection outputs

This commit is contained in:
mvdbeek
2017-08-02 19:58:37 +02:00
parent 46fba6ec1c
commit ea15f398e7
+13 -10
View File
@@ -158,16 +158,19 @@ class ToolExecutionTracker( object ):
continue
output = self.tool.outputs[ output_name ]
# Switch the structure for outputs if the output specified a default_identifier_source
collection_type_descriptions = trans.app.dataset_collections_service.collection_type_descriptions
_structure = None
source_collection = self.collection_info.collections.get(output.default_identifier_source)
if source_collection:
collection_type_description = collection_type_descriptions.for_collection_type(source_collection.collection.collection_type)
_structure = structure.for_dataset_collection( source_collection.collection, collection_type_description=collection_type_description)
if _structure and structure.can_match(_structure):
element_identifiers = _structure.element_identifiers_for_outputs(trans, outputs)
else:
element_identifiers = None
if hasattr(output, "default_identifier_source"):
# Switch the structure for outputs if the output specified a default_identifier_source
collection_type_descriptions = trans.app.dataset_collections_service.collection_type_descriptions
source_collection = self.collection_info.collections.get(output.default_identifier_source)
if source_collection:
collection_type_description = collection_type_descriptions.for_collection_type(source_collection.collection.collection_type)
_structure = structure.for_dataset_collection( source_collection.collection, collection_type_description=collection_type_description)
if structure.can_match(_structure):
element_identifiers = _structure.element_identifiers_for_outputs(trans, outputs)
if not element_identifiers:
element_identifiers = structure.element_identifiers_for_outputs( trans, outputs )
implicit_collection_info = dict(