onering-client 0.0.85 → 0.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/onering.rb +1 -1
- data/lib/onering/plugins/reporter.rb +7 -7
- metadata +1 -1
data/lib/onering.rb
CHANGED
@@ -56,7 +56,7 @@ module Onering
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
def load_plugins
|
59
|
+
def load_plugins()
|
60
60
|
# load plugins from @path
|
61
61
|
@path.compact.each do |root|
|
62
62
|
begin
|
@@ -71,16 +71,16 @@ module Onering
|
|
71
71
|
# <fact>-<fact_value> - load if <fact> == <fact_value>
|
72
72
|
#
|
73
73
|
if d == 'default' or Facter.value(d.split('-',2).first).to_s.downcase.nil_empty == d.split('-',2).last.to_s.downcase.nil_empty
|
74
|
-
Dir[File.join(directory, '*.rb')].each do |
|
75
|
-
|
74
|
+
Dir[File.join(directory, '*.rb')].each do |plugin|
|
75
|
+
plugin = File.basename(plugin, '.rb')
|
76
76
|
|
77
77
|
begin
|
78
78
|
Timeout.timeout((@options[:plugin_timeout] || 10).to_i) do
|
79
|
-
Onering::Logger.debug("Loading plugin #{
|
80
|
-
require "#{directory}/#{
|
79
|
+
Onering::Logger.debug("Loading plugin #{plugin}", "Onering::Reporter")
|
80
|
+
require "#{directory}/#{plugin}"
|
81
81
|
end
|
82
|
-
rescue Timeout::Error
|
83
|
-
Onering::Logger.warn("Plugin #{
|
82
|
+
rescue Timeout::Error => e
|
83
|
+
Onering::Logger.warn("Plugin #{plugin} took too long to return, skipping", "Onering::Reporter")
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|