From 9f3f0e21de85dde128dc9525b6f9b32bd64a362a Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Mon, 23 Oct 2023 16:11:15 -0400 Subject: [PATCH] Nuage provider assumes Qpid constant is loaded or autoloadable manageiq-providers-nuage can be eager loaded on all platforms. It's dependency, qpid_proton, is hidden because it can't be required on macos. Because this is an optional dependency, any platforms that can install it will need to eager require it since EventCatcher::MessagingHandler needs it at require/load time. The alternative is to make qpid_proton require work on mac and define these constants. For example: class ManageIQ::Providers::Nuage::NetworkManager::EventCatcher::MessagingHandler < Qpid::Proton::MessagingHandler ... end https://github.com/ManageIQ/manageiq-providers-nuage/blob/541494cded64b1ef281c71767d7d5f88cf4bb08d/app/models/manageiq/providers/nuage/network_manager/event_catcher/messaging_handler.rb#L1 --- Gemfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 38bb0cf5b0c9..b4a2d0aa743a 100644 --- a/Gemfile +++ b/Gemfile @@ -189,7 +189,11 @@ group :red_hat_virtualization, :manageiq_default do end group :qpid_proton, :optional => true do - gem "qpid_proton", "~>0.30.0", :require => false + # We're eager requiring the qpid_proton gem on platforms that install it because + # zeitwerk wants to be able to eager/autoload the nuage provider which expects + # qpid constants to be defined. For mac platform, we have stubs for these constants + # defined in lib/qpid/proton. + gem "qpid_proton", "~>0.30.0" end group :systemd, :optional => true do