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

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) ⇒ LocalChangesError

Returns a new instance of LocalChangesError.



157
158
159
160
161
162
163
# File 'lib/puppet/module_tool/errors/shared.rb', line 157

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



165
166
167
168
169
170
171
# File 'lib/puppet/module_tool/errors/shared.rb', line 165

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")
  message << _("    Use `puppet module %{action} --ignore-changes` to %{action} this module anyway") % { action: @action }
  message.join("\n")
end