Permalink
Browse files

Fixes kicker not functioning at all when mcollective is not yet insta…

…lled.

The kicker needs mcollective in the ruby load path to function.
Since most of the time mcollective is installed with puppet, we've
got a chicken and eggs case. This time, return a fake egg to keep
the birds happy.
  • Loading branch information...
1 parent 127ac12 commit 8e15c2e7214983d84f7d32af0613e7897b7556e4 @specialunderwear committed Aug 21, 2012
View
@@ -1,6 +1,6 @@
begin
require 'mcollective'
-
+
module Kicker
module Utils
def get_rpc_client(agent, facts)
@@ -27,6 +27,19 @@ def get_rpc_client(agent, facts)
module_function :get_rpc_client
end
end
-rescue NameError
+rescue NameError, LoadError
# mcollective could be not installed yet. see http://projects.puppetlabs.com/issues/12594
+ # in that case return a replacement that always returns an empty array
+ module Kicker
+ class Utils
+ def self.get_rpc_client(agent, facts)
+ return self.new
+ end
+
+ def method_missing(m, *args, &block)
+ return []
+ end
+ end
+ end
+
end
@@ -45,6 +45,6 @@ def log(msg)
)
end
-rescue NameError
+rescue NameError, LoadError
# the puppet clients don't have any activerecord. see http://projects.puppetlabs.com/issues/12594
end
@@ -31,6 +31,6 @@ def log(msg)
)
end
-rescue NameError
+rescue NameError, LoadError
# the puppet clients don't have any activerecord. see http://projects.puppetlabs.com/issues/12594
end

0 comments on commit 8e15c2e

Please sign in to comment.