Combine list comprehensions, slightly tweak logic.

This commit is contained in:
Dannon Baker
2017-06-01 10:38:18 -04:00
parent 12905321ca
commit 0954290e5d
+1 -2
View File
@@ -330,8 +330,7 @@ class TagDatasetAction(DefaultJobAction):
@classmethod
def execute(cls, app, sa_session, action, job, replacement_dict):
if action.action_arguments:
tags = [t.strip() for t in action.action_arguments.get('tags', '').split(',') if t.strip()]
tags = [t.replace('#', 'name:') if t.startswith('#') else t for t in tags]
tags = [t.replace('#', 'name:') if t.startswith('#') else t for t in [t.strip() for t in action.action_arguments.get('tags', '').split(',') if t.strip()]]
if tags:
for dataset_assoc in job.output_datasets:
if action.output_name == '' or dataset_assoc.name == action.output_name: