Skip to content

Commit

Permalink
Merge pull request #56 from DrDaveD/master
Browse files Browse the repository at this point in the history
remove old workaround for cvmfs_server < 2.7.3
  • Loading branch information
DrDaveD authored Jul 15, 2024
2 parents 8014029 + 2845041 commit 7dc3ffa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
4 changes: 4 additions & 0 deletions rpm/cvmfs-servermon.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]> - 1.27-1
- Correct inconsistent tab/space which python3 rejected.
- Fix rare error message regarding an empty last_gc status that pylint
Expand Down
22 changes: 8 additions & 14 deletions webapi/cvmfsmon_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 7dc3ffa

Please sign in to comment.