From 2845041137c0811530abcc81c9205c91a9478e4e Mon Sep 17 00:00:00 2001 From: Dave Dykstra <2129743+DrDaveD@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:27:33 -0500 Subject: [PATCH] remove old workaround for cvmfs_server < 2.7.3 --- rpm/cvmfs-servermon.spec | 4 ++++ webapi/cvmfsmon_api.py | 22 ++++++++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/rpm/cvmfs-servermon.spec b/rpm/cvmfs-servermon.spec index dfeacff..988808e 100644 --- a/rpm/cvmfs-servermon.spec +++ b/rpm/cvmfs-servermon.spec @@ -68,6 +68,10 @@ setsebool -P httpd_can_network_connect 1 2>/dev/null || true /usr/share/cvmfs-servermon %changelog +# - Remove old workaround added in version 1.12 because it incorrectly +# reported the status of a repo without an initial snapshot but with +# a completed gc. + * Mon Oct 23 2023 Dave Dykstra - 1.27-1 - Correct inconsistent tab/space which python3 rejected. - Fix rare error message regarding an empty last_gc status that pylint diff --git a/webapi/cvmfsmon_api.py b/webapi/cvmfsmon_api.py index 7cd5c8b..6574e07 100644 --- a/webapi/cvmfsmon_api.py +++ b/webapi/cvmfsmon_api.py @@ -237,20 +237,14 @@ def dispatch(version, montests, parameters, start_response, environ): if doupdated: if 'last_snapshot' not in repo_status: - # there was a bug prior to cvmfs_server 2.7.3 that - # caused garbage collection to remove the last_snapshot - # entry, so use last_gc instead if it exists - if 'last_gc' in repo_status: - repo_status['last_snapshot'] = repo_status['last_gc'] - else: - # no complete snapshot, look up snapshotting status - try: - url2 = repourl + '/.cvmfs_is_snapshotting' - request = urllib_request.Request(url2, headers=headers) - snapshotting_string = urllib_request.urlopen(request).read().decode('utf-8') - repo_status['snapshotting_since'] = snapshotting_string - except: - pass + # no complete snapshot, look up snapshotting status + try: + url2 = repourl + '/.cvmfs_is_snapshotting' + request = urllib_request.Request(url2, headers=headers) + snapshotting_string = urllib_request.urlopen(request).read().decode('utf-8') + repo_status['snapshotting_since'] = snapshotting_string + except: + pass results.append(cvmfsmon_updated.runtest(repo, limits, repo_status, updated_slowrepos, errormsg)) if domontest('gc', montests): results.append(cvmfsmon_gc.runtest(repo, limits, repo_status, errormsg))