Exception: Puppet::ModuleTool::Errors::AlreadyInstalledError Private
- Inherits:
-
InstallError
- Object
- RuntimeError
- Error
- ModuleToolError
- InstallError
- Puppet::ModuleTool::Errors::AlreadyInstalledError
- Defined in:
- lib/puppet/module_tool/errors/installer.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) ⇒ AlreadyInstalledError
constructor
private
A new instance of AlreadyInstalledError.
- #multiline ⇒ Object private
Methods inherited from ModuleToolError
Constructor Details
#initialize(options) ⇒ AlreadyInstalledError
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 AlreadyInstalledError.
7 8 9 10 11 12 13 |
# File 'lib/puppet/module_tool/errors/installer.rb', line 7 def initialize() @module_name = [:module_name] @installed_version = v([:installed_version]) @requested_version = v([:requested_version]) @local_changes = [:local_changes] super _("'%{module_name}' (%{version}) requested; '%{module_name}' (%{installed_version}) already installed") % { module_name: @module_name, version: @requested_version, installed_version: @installed_version } 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.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/puppet/module_tool/errors/installer.rb', line 15 def multiline = [] << _("Could not install module '%{module_name}' (%{version})") % { module_name: @module_name, version: @requested_version } << _(" Module '%{module_name}' (%{installed_version}) is already installed") % { module_name: @module_name, installed_version: @installed_version } << _(" Installed module has had changes made locally") unless @local_changes.empty? # TRANSLATORS `puppet module upgrade` is a command line and should not be translated << _(" Use `puppet module upgrade` to install a different version") # TRANSLATORS `puppet module install --force` is a command line and should not be translated << _(" Use `puppet module install --force` to re-install only this module") .join("\n") end |