From 631e140aaf8d5169735c929de8da09a42622022a Mon Sep 17 00:00:00 2001 From: Wilmer Uruchi Ticona Date: Tue, 20 Oct 2020 10:55:00 +0200 Subject: [PATCH] Another energy fix. Fixing length test to test for an object converted to string. --- autosubmit/database/db_jobdata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autosubmit/database/db_jobdata.py b/autosubmit/database/db_jobdata.py index 63f9cc069..63c4cf289 100644 --- a/autosubmit/database/db_jobdata.py +++ b/autosubmit/database/db_jobdata.py @@ -1256,7 +1256,7 @@ class JobDataStructure(MainDataBase): else: # Identify best source description_job = max( - jobs_in_package, key=lambda x: len(x.extra_data)) + jobs_in_package, key=lambda x: len(str(x.extra_data))) # Identify job steps keys_step = [ y for y in description_job.extra_data.keys() if '.' in y and y[y.index('.') + 1:] not in ["batch", "extern"] and y != "parents"] @@ -1290,7 +1290,7 @@ class JobDataStructure(MainDataBase): main_step = [main_step[0]] # If main step contains submit, its valid. Else, break, not valid, for key in main_step: - if "submit" not in description_job.extra_data[key].keys(): + if key not in description_job.extra_data.keys() or "submit" not in description_job.extra_data[key].keys(): keys_found = False break # Build wrapper jobs -- GitLab