This change adds a condition to the config_files method, ensuring that the file
described by ENV['SENSU_LOADED_TEMPFILE'] exists on disk before attempting
to read from that file.
This change is proposed as an alternative to #115, as that PR includes additional logic which I believe will never work as intended.
Motivation and Context
Because the value of ENV['SENSU_LOADED_TEMPFILE'] may point to a file under /tmp
or another temporary directory, we should avoid errors by validating that a file exists at
that path before trying to read from it.
Closes #115
How Has This Been Tested?
Existing tests pass.
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[x] I have updated the Changelog following the conventions laid out on Keep A Changelog
Description
This change adds a condition to the
config_files
method, ensuring that the file described byENV['SENSU_LOADED_TEMPFILE']
exists on disk before attempting to read from that file.This change is proposed as an alternative to #115, as that PR includes additional logic which I believe will never work as intended.
Motivation and Context
Because the value of
ENV['SENSU_LOADED_TEMPFILE']
may point to a file under /tmp or another temporary directory, we should avoid errors by validating that a file exists at that path before trying to read from it.Closes #115
How Has This Been Tested?
Existing tests pass.
Types of changes
Checklist:
Known Caveats
None.