From 0eecd1538635e0aa541b2623530bea75b34feaf6 Mon Sep 17 00:00:00 2001 From: David Schultz Date: Wed, 16 Oct 2024 13:08:52 -0500 Subject: [PATCH] ignore missing config for dataset details (#392) --- iceprod/website/server.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/iceprod/website/server.py b/iceprod/website/server.py index d7a31c26..bf5bdbb0 100644 --- a/iceprod/website/server.py +++ b/iceprod/website/server.py @@ -400,11 +400,14 @@ async def get(self, dataset_id): tasks = await self.rest_client.request('GET','/datasets/{}/task_counts/status'.format(dataset_id)) task_info = await self.rest_client.request('GET','/datasets/{}/task_counts/name_status'.format(dataset_id)) task_stats = await self.rest_client.request('GET','/datasets/{}/task_stats'.format(dataset_id)) - config = await self.rest_client.request('GET','/config/{}'.format(dataset_id)) + try: + config = await self.rest_client.request('GET','/config/{}'.format(dataset_id)) + except Exception: + config = {} for t in task_info: logger.info('task_info[%s] = %r', t, task_info[t]) type_ = 'UNK' - for task in config['tasks']: + for task in config.get('tasks', []): if 'name' in task and task['name'] == t: type_ = 'GPU' if 'requirements' in task and 'gpu' in task['requirements'] and task['requirements']['gpu'] else 'CPU' break