-
Notifications
You must be signed in to change notification settings - Fork 72
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
Fixes #37792 - Safe mode and bootdisk_* template helpers #167
Conversation
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.
Failing tests are related.
Using :extend_template_helpers instead of :allowed_template_helpers fix the issue when rendering bootdisk_* template helpers in the Safe mode.
968ca20
to
7d39954
Compare
Moving to draft, current changes breaks the full-host iso generation |
@nofaralfasi ready for review tested subnet, host image and full host images and all generated correctly |
This fix resolved the issue for me, but I'm unclear about why this change was necessary. @stejskalleos, could you please explain the reason for these changes? I’m assuming it was working previously, so what led to this problem? |
@nofaralfasi I believe the reason is the recent move to Zeitwerk and its way of loading modules and classes. With the original approach, the |
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.
I must admit that I still don’t fully understand some of these changes, such as the necessity of keeping the ForemanBootdisk::Scope::Bootdisk
class. However, since this resolves the issue, I don't want to hold up the merge.
For example, having this code: module ForemanBootdisk
module Templates
module Scope
# do something
end
end
end It requires you to have the following files:
Zeitwerk maps namespaces (modules or classes) to the corresponding file paths. When a constant like cc @ofedoren please feel free to correct me if I'm wrong. |
Using :extend_template_helpers instead of :allowed_template_helpers
fix the issue when rendering bootdisk_* template helpers in the Safe mode.
For steps to reproduce, see https://projects.theforeman.org/issues/37792