Exception: Puppet::ModuleTool::Errors::DowngradingUnsupportedError Private

Inherits:
UpgradeError show all
Defined in:
lib/puppet/module_tool/errors/upgrader.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) ⇒ DowngradingUnsupportedError

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 DowngradingUnsupportedError.



47
48
49
50
51
52
53
54
55
# File 'lib/puppet/module_tool/errors/upgrader.rb', line 47

def initialize(options)
  @module_name = options[:module_name]
  @requested_version = options[:requested_version]
  @installed_version = options[:installed_version]
  @conditions        = options[:conditions]
  @action            = options[:action]

  super _("Could not %{action} '%{module_name}' (%{version}); downgrades are not allowed") % { action: @action, module_name: @module_name, version: vstring }
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.



57
58
59
60
61
62
# File 'lib/puppet/module_tool/errors/upgrader.rb', line 57

def multiline
  message = []
  message << _("Could not %{action} module '%{module_name}' (%{version})") % { action: @action, module_name: @module_name, version: vstring }
  message << _("  Downgrading is not allowed.")
  message.join("\n")
end