Exception: Puppet::ModuleTool::Errors::VersionAlreadyInstalledError
- Inherits:
-
UpgradeError
- Object
- RuntimeError
- Error
- ModuleToolError
- UpgradeError
- Puppet::ModuleTool::Errors::VersionAlreadyInstalledError
- Defined in:
- lib/puppet/module_tool/errors/upgrader.rb
Instance Attribute Summary collapse
-
#newer_versions ⇒ Object
readonly
Returns the value of attribute newer_versions.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(options) ⇒ VersionAlreadyInstalledError
constructor
A new instance of VersionAlreadyInstalledError.
- #multiline ⇒ Object
Methods inherited from ModuleToolError
Constructor Details
#initialize(options) ⇒ VersionAlreadyInstalledError
Returns a new instance of VersionAlreadyInstalledError.
13 14 15 16 17 18 19 20 21 |
# File 'lib/puppet/module_tool/errors/upgrader.rb', line 13 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)
Returns the value of attribute newer_versions.
11 12 13 |
# File 'lib/puppet/module_tool/errors/upgrader.rb', line 11 def newer_versions @newer_versions end |
Instance Method Details
#multiline ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/puppet/module_tool/errors/upgrader.rb', line 23 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 << _(" Use `puppet module upgrade --force` to upgrade only this module") .join("\n") end |