Exception: Puppet::ModuleTool::Errors::NoVersionsSatisfyError Private
- Inherits:
-
ModuleToolError
- Object
- RuntimeError
- Error
- ModuleToolError
- Puppet::ModuleTool::Errors::NoVersionsSatisfyError
- 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
Instance Method Summary collapse
-
#initialize(options) ⇒ NoVersionsSatisfyError
constructor
private
A new instance of NoVersionsSatisfyError.
- #multiline ⇒ Object private
Methods inherited from ModuleToolError
Constructor Details
#initialize(options) ⇒ NoVersionsSatisfyError
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 NoVersionsSatisfyError.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 5 def initialize() @requested_name = [:requested_name] @requested_version = [:requested_version] @installed_version = [:installed_version] @conditions = [:conditions] @action = [:action] @unsatisfied = [:unsatisfied] super _("Could not %{action} '%{module_name}' (%{version}); no version satisfies all dependencies") % { action: @action, module_name: @requested_name, version: vstring } end |
Instance Method Details
#multiline ⇒ Object
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.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 16 def multiline = [] << _("Could not %{action} module '%{module_name}' (%{version})") % { action: @action, module_name: @requested_name, version: vstring } if @unsatisfied << _(" The requested version cannot satisfy one or more of the following installed modules:") if @unsatisfied[:current_version] << _(" %{name}, installed: %{current_version}, expected: %{constraints}") % { name: @unsatisfied[:name], current_version: @unsatisfied[:current_version], constraints: @unsatisfied[:constraints][@unsatisfied[:name]] } else @unsatisfied[:constraints].each do |mod, range| << _(" %{mod}, expects '%{name}': %{range}") % { mod: mod, name: @requested_name, range: range } end end << _("") else << _(" The requested version cannot satisfy all dependencies") end # TRANSLATORS `puppet module %{action} --ignore-dependencies` is a command line and should not be translated << _(" Use `puppet module %{action} '%{module_name}' --ignore-dependencies` to %{action} only this module") % { action: @action, module_name: @requested_name } .join("\n") end |