Skip to content

fix: files and templates in nested directories are not placed correctly#89

Merged
richm merged 1 commit intolinux-system-roles:mainfrom
richm:fix-allow-nested-files-templates
Apr 29, 2025
Merged

fix: files and templates in nested directories are not placed correctly#89
richm merged 1 commit intolinux-system-roles:mainfrom
richm:fix-allow-nested-files-templates

Conversation

@richm
Copy link
Contributor

@richm richm commented Apr 28, 2025

Cause: If the user specified a file or template source within a nested
directory, the role was using the whole path and not just the basename
for the name of the destination file.

Consequence: The role was trying to place files and templates in the
same directory structure on the destination, which is not supported
by systemd.

Fix: Ensure the basename of the given file or template is used to
construct the path to the destination.

Result: The role works even when the source files and templates are
in nested directories.

NOTE: If you were relying on the old broken code to make deeply nested
systemd and drop-in directories on the destination, and that somehow
was working, it will no longer be working.

Signed-off-by: Rich Megginson rmeggins@redhat.com

@richm richm requested a review from spetrosi as a code owner April 28, 2025 23:29
@richm
Copy link
Contributor Author

richm commented Apr 28, 2025

Fixes #84

Cause: If the user specified a file or template source within a nested
directory, the role was using the whole path and not just the basename
for the name of the destination file.

Consequence: The role was trying to place files and templates in the
same directory structure on the destination, which is not supported
by systemd.

Fix: Ensure the basename of the given file or template is used to
construct the path to the destination.

Result: The role works even when the source files and templates are
in nested directories.

NOTE: If you were relying on the old broken code to make deeply nested
systemd and drop-in directories on the destination, and that somehow
was working, it will no longer be working.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
@richm richm force-pushed the fix-allow-nested-files-templates branch from eeaf69f to fc19dfb Compare April 28, 2025 23:35
@richm
Copy link
Contributor Author

richm commented Apr 28, 2025

[citest]

@richm richm merged commit f93b7a8 into linux-system-roles:main Apr 29, 2025
26 checks passed
@richm richm deleted the fix-allow-nested-files-templates branch April 29, 2025 18:17
@codecov
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@f2c6153). Learn more about missing BASE report.

Additional details and impacted files
@@         Coverage Diff          @@
##             main   #89   +/-   ##
====================================
  Coverage        ?     0           
====================================
  Files           ?     0           
  Lines           ?     0           
  Branches        ?     0           
====================================
  Hits            ?     0           
  Misses          ?     0           
  Partials        ?     0           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant