Skip to content
Snippets Groups Projects

In case fullName is not found by trf, avoiding exception

Merged Zach Marshall requested to merge zmarshal/athena:cvmfs_failure_resiliance into main

In some recent grid jobs, cvmfs goes stale. In those cases, the file that this piece of code is looking for won't be found. Right now it looks for the file, identifies that it isn't there, and prints a warning (because the filename is None). It then tries to open the file anyway. Looking at the code, I can't imagine that's what was intended, because even in the case that it fails to open the code because of an OSError it just prints a warning and continues. Therefore adding an 'else' here to avoid opening the file in case the name is None. This could also be done by catching a TypeError exception, but I don't see why we should use try/except logic when we have a nice clean way to test for the condition with an if statement (and we already do).

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading