Skip to content

Fix Ruby 3.3 constant lookup for HostStatus - #69

Open
zjhuntin wants to merge 1 commit into
theforeman:masterfrom
zjhuntin:fix/ruby33-constant-lookup
Open

Fix Ruby 3.3 constant lookup for HostStatus#69
zjhuntin wants to merge 1 commit into
theforeman:masterfrom
zjhuntin:fix/ruby33-constant-lookup

Conversation

@zjhuntin

Copy link
Copy Markdown

Summary

  • Qualify HostStatus with :: prefix in engine.rb plugin registration block

On Ruby 3.3 (shipped with EL10), constant lookup inside instance_eval blocks no longer falls through to top-level scope. The unqualified HostStatus::OmahaStatus reference on line 31 causes:

NameError: uninitialized constant ForemanOmaha::Engine::HostStatus

This breaks the plugin:assets:precompile rake task during RPM build, preventing the package from building on EL10.

Other Foreman plugins (e.g. foreman_openscap) already use fully qualified constants like ForemanOpenscap::ComplianceStatus in the same context and work correctly.

On Ruby 3.3, constant lookup inside instance_eval blocks no longer
falls through to top-level scope. Qualify HostStatus with :: to
ensure it resolves correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant