def load_plugin_class(plugin_path, plugin_dir_path=nil)
contents = ""
begin
contents << IO.read(plugin_path)
rescue IOError, Errno::ENOENT
Ohai::Log.warn("Unable to open or read plugin at #{plugin_path}")
return nil
end
if contents.include?("Ohai.plugin")
load_v7_plugin_class(contents, plugin_path)
else
Ohai::Log.warn("[DEPRECATION] Plugin at #{plugin_path} is a version 6 plugin. \
Version 6 plugins will not be supported in future releases of Ohai. \
Please upgrade your plugin to version 7 plugin syntax. \
For more information visit here: docs.opscode.com/ohai_custom.html")
load_v6_plugin_class(contents, plugin_path, plugin_dir_path)
end
end