From c1facd3d878d1d5373df5a5f371d778af43b63ee Mon Sep 17 00:00:00 2001 From: Themis Zamani Date: Tue, 12 Apr 2022 10:23:16 +0300 Subject: [PATCH 1/2] Put a check for files. The script was throwing an error. CRITICAL: NameError("name 'files' is not defined",) --- check_b2share.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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: From 1d2bc9370f8ad5714c493e21771db7ae49eb8745 Mon Sep 17 00:00:00 2001 From: Themis Zamani Date: Tue, 12 Apr 2022 10:29:06 +0300 Subject: [PATCH 2/2] Update argo-probe-eudat-b2share.spec --- argo-probe-eudat-b2share.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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+