Skip to content

Conversation

@twiggler
Copy link
Contributor

@twiggler twiggler commented May 6, 2025

Fixes:

  • _select_parser could be invoked with a Path, while it expects a FileSystemEntry. Additionally, there were multiple code paths in parse and parse_config to support TargetPath, Path, and File objects. Removed the dependence on FileSystemEntry by converting entries to TargetPath in the config file system.
  • Systemd network parser did not collapse singleton values
  • When multiple sections with the same name are encountered, the resulting key is a list of those sections:
    Example:
key value1
   key2 value2a
key value1
   key2 value2b
   key3 value3b

now parses as {"key value1": [{"key2": "value2a"}, {"key2": "value2b", "key3": "value3b"}]}. Previously, this parsed as {"key value1": {"key2": ["value2a", "value2b"], "key3": "value3b"}}, where the parallel lists could become misaligned.

Supports:

  • Drop files when invoking parse with a systemd file
  • Empty value now clears corresponding key when merging systemd files.

@twiggler twiggler changed the title Support for drop files Support systemd drop files May 6, 2025
@codecov
Copy link

codecov bot commented May 6, 2025

Codecov Report

Attention: Patch coverage is 95.23810% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.85%. Comparing base (e56c684) to head (50f3a87).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
dissect/target/helpers/configutil.py 94.54% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1136      +/-   ##
==========================================
- Coverage   77.91%   77.85%   -0.06%     
==========================================
  Files         359      359              
  Lines       32665    32701      +36     
==========================================
+ Hits        25450    25460      +10     
- Misses       7215     7241      +26     
Flag Coverage Δ
unittests 77.85% <95.23%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@twiggler twiggler marked this pull request as ready for review May 6, 2025 15:53
@EinatFox EinatFox linked an issue May 7, 2025 that may be closed by this pull request
@codspeed-hq
Copy link

codspeed-hq bot commented May 19, 2025

CodSpeed Performance Report

Merging #1136 will not alter performance

Comparing systemd-drop (50f3a87) with main (e56c684)

Summary

✅ 3 untouched benchmarks

@twiggler twiggler merged commit cd4b450 into main May 19, 2025
22 of 25 checks passed
@twiggler twiggler deleted the systemd-drop branch May 19, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support drop-in configuration files for systemd

3 participants