# class Puppet::ModuleTool::Errors::AlreadyInstalledError

### Public Class Methods

new(options) click to toggle source
Calls superclass method Puppet::Error.new

    # File lib/puppet/module_tool/errors/installer.rb, line 6
    def initialize(options)
      @module_name       = options[:module_name]
      @installed_version = v(options[:installed_version])
      @requested_version = v(options[:requested_version])
      @local_changes     = options[:local_changes]
      super "'#{@module_name}' (#{@requested_version}) requested; '#{@module_name}' (#{@installed_version}) already installed"
    end

### Public Instance Methods

multiline() click to toggle source

    # File lib/puppet/module_tool/errors/installer.rb, line 14
    def multiline
      message = []
      message << "Could not install module '#{@module_name}' (#{@requested_version})"
      message << "  Module '#{@module_name}' (#{@installed_version}) is already installed"
      message << "    Installed module has had changes made locally" unless @local_changes.empty?
      message << "    Use `puppet module upgrade` to install a different version"
      message << "    Use `puppet module install --force` to re-install only this module"
      message.join("\n")
    end