def initialize_plugin(plugin, plugin_info, options = {})
      options = {
        :log => @log
      }.merge(options)

      unless @plugin_chain.empty?
        options.merge!(:previous_plugin => @plugin_chain.last[:plugin])
      end

      plugin.init(@config, @appliance_config, plugin_info, options)

      # Execute callbacks if implemented
      #
      # Order is very important
      [:after_init, :validate, :after_validate].each do |callback|
        plugin.send(callback) if plugin.respond_to?(callback)
      end

      param = nil

      # For operating system plugins we need to inject appliance definition.
      if plugin_info[:type] == :os
        param = @appliance_definition
      end

      @plugin_chain << {:plugin => plugin, :param => param}
    end
def initialize_plugin(plugin, plugin_info, options = {})
      options = {
        :log => @log
      }.merge(options)

      unless @plugin_chain.empty?
        options.merge!(:previous_plugin => @plugin_chain.last[:plugin])
      end

      plugin.init(@config, @appliance_config, plugin_info, options)

      # Execute callbacks if implemented
      #
      # Order is very important
      [:after_init, :validate, :after_validate].each do |callback|
        plugin.send(callback) if plugin.respond_to?(callback)
      end

      param = nil

      # For operating system plugins we need to inject appliance definition.
      if plugin_info[:type] == :os
        param = @appliance_definition
      end

      @plugin_chain << {:plugin => plugin, :param => param}
    end
Initializes the plugin by executing init, after_init, validate and after_validate methods.

 We can be sure only for init method because it is implemented internally in base-plugin.rb,
 for all other methods we need to check if they exist.