Exception: Puppet::ModuleTool::Errors::ModuleIsRequiredError Private
- Inherits:
-
UninstallError
- Object
- RuntimeError
- Error
- ModuleToolError
- UninstallError
- Puppet::ModuleTool::Errors::ModuleIsRequiredError
- Defined in:
- lib/puppet/module_tool/errors/uninstaller.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) ⇒ ModuleIsRequiredError
constructor
private
A new instance of ModuleIsRequiredError.
- #multiline ⇒ Object private
Methods inherited from ModuleToolError
Constructor Details
#initialize(options) ⇒ ModuleIsRequiredError
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 ModuleIsRequiredError.
26 27 28 29 30 31 32 33 |
# File 'lib/puppet/module_tool/errors/uninstaller.rb', line 26 def initialize() @module_name = [:module_name] @required_by = [:required_by] @requested_version = [:requested_version] @installed_version = [:installed_version] super _("Could not uninstall '%{module_name}'; installed modules still depend upon it") % { module_name: @module_name } 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.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/puppet/module_tool/errors/uninstaller.rb', line 35 def multiline = [] if @requested_version << _("Could not uninstall module '%{module_name}' (v%{requested_version})") % { module_name: @module_name, requested_version: @requested_version } else << _("Could not uninstall module '%{module_name}'") % { module_name: @module_name } end << _(" Other installed modules have dependencies on '%{module_name}' (%{version})") % { module_name: @module_name, version: v(@installed_version) } += @required_by.map do |mod| _(" '%{module_name}' (%{version}) requires '%{module_dep}' (%{dep_version})") % { module_name: mod['name'], version: v(mod['version']), module_dep: @module_name, dep_version: v(mod['version_requirement']) } end # TRANSLATORS `puppet module uninstall --force` is a command line option that should not be translated << _(" Use `puppet module uninstall --force` to uninstall this module anyway") .join("\n") end |