Don't log SEVERE exception if /bin/hostname is missing#339
Conversation
Instead, log to FINE level, swallow the exception, and try the next method.
/bin/hostname is missing
jglick
left a comment
There was a problem hiding this comment.
Why is it not just
return InetAddress.getLocalHost().getHostName();to begin with?
|
From what I read |
|
Thanks for the contribution @Vlatombe!
That sounds like a good addition. Do you have a specific controller environment variable in mind? |
|
@sarah-witt I filed it as a separate PR -- #340 |
|
@sarah-witt any chance to get this released ? |
|
Hi @Dohbedoh, we plan to make a release this week! |
|
Hi @sarah-witt, awesome! thanks |
|
@Dohbedoh datadog plugin version 5.4.1 was released earlier today: https://plugins.jenkins.io/datadog/releases/! |
Instead, log to FINE level, swallow the exception, and try the next method.
I'm running the plugin in a container where
/bin/hostnameis not present, and the plugin is spamming the logs with the followingRequirements for Contributing to this repository
What does this PR do?
Description of the Change
Alternate Designs
Possible Drawbacks
Verification Process
Additional Notes
Release Notes
Review checklist (to be filled by reviewers)
changelog/label attached. If applicable it should have thebackward-incompatiblelabel attached.do-not-merge/label attached.kind/andseverity/labels attached at least.