-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix hostname plugin for RedHat systems #513
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #513 +/- ##
==========================================
+ Coverage 73.76% 73.79% +0.03%
==========================================
Files 276 276
Lines 22997 23012 +15
==========================================
+ Hits 16963 16981 +18
+ Misses 6034 6031 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change the commit/PR message according to https://docs.dissect.tools/en/latest/contributing/style-guide.html#commit-message-style-and-formatting
The functionality of the injected target is not RedHat specific, hence a target of type Unix is more fitting. Changed therefore the injected target for the tests to be Unix. (#DIS-2796)
…type path This commit removes a redundant conversion from str to Path. These can be better compared through getting a string representation from a Path, which is less expensive.
These tests cover cases where the path supplied does not match the expected path or the file is empty. These test cases highlighted bugs introduced from past commits, which are also fixed in this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on RH 7, works.
Wrote as fix for ticket DIS-2796, where the hostname could not be found for Red Hat systems. The hostname for these files is instead of /etc/hostname found within /etc/sysconfig/network.