diff --git a/argo-probe-eudat-b2share.spec b/argo-probe-eudat-b2share.spec index d09be81..9c6c62c 100644 --- a/argo-probe-eudat-b2share.spec +++ b/argo-probe-eudat-b2share.spec @@ -1,5 +1,5 @@ Name: argo-probe-eudat-b2share -Version: 0.5 +Version: 0.6 Release: 1%{?dist} Summary: Monitoring scripts that check the functionalities of B2SHARE License: GPLv3+ diff --git a/check_b2share.py b/check_b2share.py index a1db093..1aea6e4 100755 --- a/check_b2share.py +++ b/check_b2share.py @@ -149,13 +149,14 @@ def get_dict_from_url(url, verify_tls_cert=False, verbosity=False): rec_with_files_url = None for hit in search_results['hits']['hits']: - # Check if there are files in the record - if len(hit['files']) > 0: - # NTS: Could throw KeyError if there is something - # seriously wrong or B2SHARE REST API responses have - # changed. - rec_with_files_url = hit['links']['self'] - break + if 'files' in hit: + # Check if there are files in the record + if len(hit['files']) > 0: + # NTS: Could throw KeyError if there is something + # seriously wrong or B2SHARE REST API responses have + # changed. + rec_with_files_url = hit['links']['self'] + break if rec_with_files_url: