Exception: Puppet::ModuleTool::Errors::VersionAlreadyInstalledError Private
- Inherits:
-
UpgradeError
- Object
- RuntimeError
- Error
- ModuleToolError
- UpgradeError
- Puppet::ModuleTool::Errors::VersionAlreadyInstalledError
- 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 collapse
- #newer_versions ⇒ Object readonly private
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(options) ⇒ VersionAlreadyInstalledError
constructor
private
A new instance of VersionAlreadyInstalledError.
- #multiline ⇒ Object private
Methods inherited from ModuleToolError
Constructor Details
#initialize(options) ⇒ VersionAlreadyInstalledError
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 VersionAlreadyInstalledError.
14 15 16 17 18 19 20 21 22 |
# File 'lib/puppet/module_tool/errors/upgrader.rb', line 14 def initialize() @module_name = [:module_name] @requested_version = [:requested_version] @installed_version = [:installed_version] @dependency_name = [:dependency_name] @newer_versions = [:newer_versions] @possible_culprits = [:possible_culprits] super _("Could not upgrade '%{module_name}'; more recent versions not found") % { module_name: @module_name } end |
Instance Attribute Details
#newer_versions ⇒ Object (readonly)
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.
12 13 14 |
# File 'lib/puppet/module_tool/errors/upgrader.rb', line 12 def newer_versions @newer_versions 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.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/puppet/module_tool/errors/upgrader.rb', line 24 def multiline = [] << _("Could not upgrade module '%{module_name}' (%{version})") % { module_name: @module_name, version: vstring } if @newer_versions.empty? << _(" The installed version is already the latest version matching %{version}") % { version: vstring } else << _(" There are %{count} newer versions") % { count: @newer_versions.length } << _(" No combination of dependency upgrades would satisfy all dependencies") unless @possible_culprits.empty? << _(" Dependencies will not be automatically upgraded across major versions") << _(" Upgrading one or more of these modules may permit the upgrade to succeed:") @possible_culprits.each do |name| << " - #{name}" end end end # TRANSLATORS `puppet module upgrade --force` is a command line option that should not be translated << _(" Use `puppet module upgrade --force` to upgrade only this module") .join("\n") end |