Skip to content

Commit

Permalink
cloudinit.log: Use more appropriate exception (#4435)
Browse files Browse the repository at this point in the history
cloud-init's logging code has for a long time caught and ignored a bare
Exception. Use a more specific exception for the expected case that this
handles.
  • Loading branch information
holmanb committed Sep 20, 2023
1 parent 8a56a29 commit 3a9c178
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cloudinit/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def setupLogging(cfg=None):
# The default configuration includes an attempt at using /dev/log,
# followed up by writing to a file. /dev/log will not exist in
# very early boot, so an exception on that is expected.
with suppress(Exception):
with suppress(FileNotFoundError):
am_tried += 1

# If the value is not a filename, assume that it is a config.
Expand Down

0 comments on commit 3a9c178

Please sign in to comment.