Exception: Puppet::ModuleTool::Errors::LocalChangesError Private

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary

Attributes inherited from Error

#original

Instance Method Summary collapse

Methods inherited from ModuleToolError

#v, #vstring

Constructor Details

#initialize(options) ⇒ LocalChangesError

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of LocalChangesError.


193
194
195
196
197
198
199
# File 'lib/puppet/module_tool/errors/shared.rb', line 193

def initialize(options)
  @module_name       = options[:module_name]
  @requested_version = options[:requested_version]
  @installed_version = options[:installed_version]
  @action            = options[:action]
  super _("Could not %{action} '%{module_name}'; module has had changes made locally") % { action: @action, module_name: @module_name }
end

Instance Method Details

#multilineObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


201
202
203
204
205
206
207
208
# File 'lib/puppet/module_tool/errors/shared.rb', line 201

def multiline
  message = []
  message << _("Could not %{action} module '%{module_name}' (%{version})") % { action: @action, module_name: @module_name, version: vstring }
  message << _("  Installed module has had changes made locally")
  #TRANSLATORS `puppet module %{action} --ignore-changes` is a command line and should not be translated
  message << _("    Use `puppet module %{action} --ignore-changes` to %{action} this module anyway") % { action: @action }
  message.join("\n")
end