From 2939863efc1cc0e9e63b7eebfe8a712f077488cc Mon Sep 17 00:00:00 2001 From: geemus Date: Tue, 25 Oct 2022 10:29:50 -0500 Subject: [PATCH] check for constant defined before trying to const get in bin tests --- lib/fog/bin.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/fog/bin.rb b/lib/fog/bin.rb index ca0945109..e06b62f30 100644 --- a/lib/fog/bin.rb +++ b/lib/fog/bin.rb @@ -3,7 +3,9 @@ require 'fog/core/credentials' module Fog class << self def available_providers - @available_providers ||= Fog.providers.values.select {|provider| Kernel.const_get(provider).try(:available?)}.sort + available_providers ||= Fog.providers.values.select do |provider| + Kernel.const_defined?(provider) && Kernel.const_get(provider).try(:available?) + end.sort end def registered_providers