Exception: Puppet::ModuleTool::Errors::MultipleInstalledError

Inherits:
ModuleToolError show all
Defined in:
lib/puppet/module_tool/errors/shared.rb

Instance Attribute Summary

Attributes inherited from Error

#original

Instance Method Summary collapse

Methods inherited from ModuleToolError

#v, #vstring

Constructor Details

#initialize(options) ⇒ MultipleInstalledError

Returns a new instance of MultipleInstalledError.



136
137
138
139
140
141
142
# File 'lib/puppet/module_tool/errors/shared.rb', line 136

def initialize(options)
  @module_name = options[:module_name]
  @modules     = options[:installed_modules]
  @action      = options[:action]
  #TRANSLATORS "module path" refers to a set of directories where modules may be installed
  super _("Could not %{action} '%{module_name}'; module appears in multiple places in the module path") % { action: @action, module_name: @module_name }
end

Instance Method Details

#multilineObject



144
145
146
147
148
149
150
151
152
153
# File 'lib/puppet/module_tool/errors/shared.rb', line 144

def multiline
  message = []
  message << _("Could not %{action} module '%{module_name}'") % { action: @action, module_name: @module_name }
  message << _("  Module '%{module_name}' appears multiple places in the module path") % { module_name: @module_name }
  message += @modules.map do |mod|
    _("    '%{module_name}' (%{version}) was found in %{path}") % { module_name: @module_name, version: v(mod.version), path: mod.modulepath }
  end
  message << _("    Use the `--modulepath` option to limit the search to specific directories")
  message.join("\n")
end