Permalink
Browse files

Making it work again with fog 1.10

in 1.9, the original code was sufficient, but 1.10 has a massive
refactoring in the way of registering providers. Unless at least one
provider is registered, the providers hash is empty, and it causes
an exception like the following:

/var/lib/gems/1.8/gems/fog-1.10.0/lib/fog/compute.rb:39:in `new': undefined method `include?' for nil:NilClass (NoMethodError)
    from /home/kohsuke/ws/cloudbees/blimpy/lib/blimpy/boxes/aws.rb:39:in `fog'
    from /home/kohsuke/ws/cloudbees/blimpy/lib/blimpy/boxes/aws.rb:32:in `validate!'
    from /home/kohsuke/ws/cloudbees/blimpy/lib/blimpy/fleet.rb:110:in `start'
    from /home/kohsuke/ws/cloudbees/blimpy/lib/blimpy/fleet.rb:109:in `each'
    from /home/kohsuke/ws/cloudbees/blimpy/lib/blimpy/fleet.rb:109:in `start'
    from /home/kohsuke/ws/cloudbees/blimpy/lib/blimpy/cli.rb:73:in `start'
    from /var/lib/gems/1.8/gems/thor-0.18.0/lib/thor/command.rb:27:in `__send__'
    from /var/lib/gems/1.8/gems/thor-0.18.0/lib/thor/command.rb:27:in `run'
    from /var/lib/gems/1.8/gems/thor-0.18.0/lib/thor/invocation.rb:120:in `invoke_command'
    from /var/lib/gems/1.8/gems/thor-0.18.0/lib/thor.rb:363:in `dispatch'
    from /var/lib/gems/1.8/gems/thor-0.18.0/lib/thor/base.rb:427:in `start'
    from /home/kohsuke/ws/cloudbees/blimpy/bin/blimpy:24

By forcing the registration of a provider, it works against with fog
1.10. Looking at the source tree, this change should also work with fog
1.9.
  • Loading branch information...
1 parent de4830f commit cd1ebc211d3640db8e14d285c6c73e20444ce8f7 @kohsuke kohsuke committed Mar 29, 2013
Showing with 2 additions and 0 deletions.
  1. +1 −0 lib/blimpy/boxes/aws.rb
  2. +1 −0 lib/blimpy/boxes/openstack.rb
View
@@ -1,5 +1,6 @@
require 'blimpy/box'
require 'blimpy/boxes'
+require 'fog/aws'
module Blimpy::Boxes
class AWS < Blimpy::Box
@@ -1,5 +1,6 @@
require 'blimpy/box'
require 'blimpy/boxes'
+require 'fog/openstack'
module Blimpy::Boxes
class OpenStack < Blimpy::Box

0 comments on commit cd1ebc2

Please sign in to comment.