lib/ohai/dsl/plugin/versionvii.rb in ohai-13.1.0 vs lib/ohai/dsl/plugin/versionvii.rb in ohai-13.2.0
- old
+ new
@@ -83,15 +83,15 @@
def run_plugin
collector = self.class.data_collector
platform = collect_os
if collector.has_key?(platform)
- self.instance_eval(&collector[platform])
+ instance_eval(&collector[platform])
elsif collector.has_key?(:default)
- self.instance_eval(&collector[:default])
+ instance_eval(&collector[:default])
else
- Ohai::Log.debug("Plugin #{self.name}: No data to collect. Skipping...")
+ Ohai::Log.debug("Plugin #{name}: No data to collect. Skipping...")
end
end
def provides(*paths)
Ohai::Log.warn("[UNSUPPORTED OPERATION] \'provides\' is no longer supported in a \'collect_data\' context. Please specify \'provides\' before collecting plugin data. Ignoring command \'provides #{paths.join(", ")}")
@@ -120,10 +120,10 @@
def fetch_plugin_config
# DMI => ["DMI"]
# Memory => ["", "Memory"]
# NetworkListeners => ["", "Network", "", "Listeners"]
# SSHHostKey => ["SSH", "Host", "", "Key"]
- parts = self.name.to_s.split(/([A-Z][a-z]+)/)
+ parts = name.to_s.split(/([A-Z][a-z]+)/)
# ["DMI"] => ["DMI"]
# ["", "Memory"] => ["Memory"]
# ["", "Network", "", "Listeners"] => ["Network", "Listeners"]
# ["SSH", "Host", "", "Key"] => ["SSH", "Host", "Key"]
parts.delete_if { |part| part.empty? }