From ac71467880ed048db68f6df4e90dfe4cd4b83271 Mon Sep 17 00:00:00 2001 From: Aleksandr Alekseev Date: Thu, 30 May 2024 15:24:27 +0200 Subject: [PATCH] Fixing jobs view for COMPASS --- core/views.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/views.py b/core/views.py index 3a798138..b43d540f 100644 --- a/core/views.py +++ b/core/views.py @@ -1685,8 +1685,15 @@ def jobList(request, mode=None, param=None): pq_dict = get_panda_queues() for job in jobsToShow: if job['computingsite'] in pq_dict: - job['computingsitestatus'] = pq_dict[job['computingsite']]['status'] - job['computingsitecomment'] = pq_dict[job['computingsite']]['comment'] + if 'status' in pq_dict[job['computingsite']]: + job['computingsitestatus'] = pq_dict[job['computingsite']]['status'] + else: + job['computingsitestatus'] = 'UNKNOWN' + if 'comment' in pq_dict[job['computingsite']]: + job['computingsitecomment'] = pq_dict[job['computingsite']]['comment'] + else: + job['computingsitecomment'] = 'UNKNOWN' + _logger.debug('Got extra params for sites: {}'.format(time.time() - request.session['req_init_time'])) # checking if log file replica available