modules/mu/cloud/providers.rb in cloud-mu-3.4.0 vs modules/mu/cloud/providers.rb in cloud-mu-3.5.0
- old
+ new
@@ -62,10 +62,15 @@
# Load the container class for each cloud we know about, and inject autoload
# code for each of its supported resource type classes.
failed = []
MU::Cloud.supportedClouds.each { |cloud|
- require "mu/providers/#{cloud.downcase}"
+ begin
+ require "mu/providers/#{cloud.downcase}"
+ rescue LoadError, Gem::MissingSpecError => e
+ MU.log "Error loading #{cloud} library, calls into this provider will fail", MU::ERR, details: e.message
+ next
+ end
cloudclass = Object.const_get("MU").const_get("Cloud").const_get(cloud)
@@generic_class_methods_toplevel.each { |method|
if !cloudclass.respond_to?(method)
MU.log "MU::Cloud::#{cloud} has not implemented required class method #{method}, disabling", MU::ERR
failed << cloud