Exception: Puppet::ModuleTool::Errors::InstallConflictError
- Inherits:
-
ModuleToolError
- Object
- RuntimeError
- Error
- ModuleToolError
- Puppet::ModuleTool::Errors::InstallConflictError
- Defined in:
- lib/puppet/module_tool/errors/shared.rb
Instance Attribute Summary
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(options) ⇒ InstallConflictError
constructor
A new instance of InstallConflictError.
- #multiline ⇒ Object
Methods inherited from ModuleToolError
Constructor Details
#initialize(options) ⇒ InstallConflictError
Returns a new instance of InstallConflictError.
55 56 57 58 59 60 61 62 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 55 def initialize() @requested_module = [:requested_module] @requested_version = v([:requested_version]) @dependency = [:dependency] @directory = [:directory] @metadata = [:metadata] super _("'%{module_name}' (%{version}) requested; installation conflict") % { module_name: @requested_module, version: @requested_version } end |
Instance Method Details
#multiline ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/puppet/module_tool/errors/shared.rb', line 64 def multiline = [] << _("Could not install module '%{module_name}' (%{version})") % { module_name: @requested_module, version: @requested_version } if @dependency << _(" Dependency '%{name}' (%{version}) would overwrite %{dir}") % { name: @dependency[:name], version: v(@dependency[:version]), dir: @directory } else << _(" Installation would overwrite %{dir}") % { dir: @directory } end if @metadata << _(" Currently, '%{name}' (%{version}) is installed to that directory") % { name: @metadata["name"], version: v(@metadata["version"]) } end if @dependency << _(" Use `puppet module install --ignore-dependencies` to install only this module") else << _(" Use `puppet module install --force` to install this module anyway") end .join("\n") end |