lib/chef/knife/vsphere_vm_clone.rb
def customization_plugin
    if @customization_plugin.nil?
      cplugin_path = get_config(:customization_plugin)
      if cplugin_path
        if File.exist? cplugin_path
          require cplugin_path
        else
          abort "Customization plugin could not be found at #{cplugin_path}"
        end

        if Object.const_defined? 'KnifeVspherePlugin'
          @customization_plugin = Object.const_get('KnifeVspherePlugin').new
          cplugin_data = get_config(:customization_plugin_data)
          if cplugin_data
            if @customization_plugin.respond_to?(:data=)
              @customization_plugin.data = cplugin_data
            else
              abort 'Customization plugin has no :data= accessor to receive the --cplugin-data argument.  Define both or neither.'
            end
          end
        else
          abort "KnifeVspherePlugin class is not defined in #{cplugin_path}"
        end
      end
    end

    @customization_plugin
  end
# Loads the customization plugin if one was specified
# @return [KnifeVspherePlugin] the loaded and initialized plugin or nil
Loads the customization plugin if one was specified
Loads the customization plugin if one was specified
def customization_plugin
    if @customization_plugin.nil?
      cplugin_path = get_config(:customization_plugin)
      if cplugin_path
        if File.exist? cplugin_path
          require cplugin_path
        else
          abort "Customization plugin could not be found at #{cplugin_path}"
        end
        if Object.const_defined? 'KnifeVspherePlugin'
          @customization_plugin = Object.const_get('KnifeVspherePlugin').new
          cplugin_data = get_config(:customization_plugin_data)
          if cplugin_data
            if @customization_plugin.respond_to?(:data=)
              @customization_plugin.data = cplugin_data
            else
              abort 'Customization plugin has no :data= accessor to receive the --cplugin-data argument.  Define both or neither.'
            end
          end
        else
          abort "KnifeVspherePlugin class is not defined in #{cplugin_path}"
        end
      end
    end
    @customization_plugin
  end
def customization_plugin if @customization_plugin . nil? cplugin_path = get_config ( :customization_plugin ) if cplugin_path if File . exist? cplugin_path require cplugin_path else abort "Customization plugin could not be found at #{cplugin_path}" end if Object . const_defined? 'KnifeVspherePlugin' @customization_plugin = Object . const_get ( 'KnifeVspherePlugin' ) . new cplugin_data = get_config ( :customization_plugin_data ) if cplugin_data if @customization_plugin . respond_to? ( :data= ) @customization_plugin . data = cplugin_data else abort 'Customization plugin has no :data= accessor to receive the --cplugin-data argument.  Define both or neither.' end end else abort "KnifeVspherePlugin class is not defined in #{cplugin_path}" end end end @customization_plugin end
Loads the customization plugin if one was specified
Loads the customization plugin if one was specified
the loaded and initialized plugin or nil
the loaded and initialized plugin or nil
KnifeVspherePlugin