Exception: Puppet::ModuleTool::Errors::InvalidDependencyCycleError Private

Inherits:
ModuleToolError show all
Defined in:
lib/puppet/module_tool/errors/shared.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

#original

Instance Method Summary collapse

Methods inherited from ModuleToolError

#v, #vstring

Constructor Details

#initialize(options) ⇒ InvalidDependencyCycleError

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 InvalidDependencyCycleError.


103
104
105
106
107
108
109
110
111
# File 'lib/puppet/module_tool/errors/shared.rb', line 103

def initialize(options)
  @module_name       = options[:module_name]
  @requested_module  = options[:requested_module]
  @requested_version = options[:requested_version]
  @conditions        = options[:conditions]
  @source            = options[:source][1..-1]

  super _("'%{module_name}' (%{version}) requested; Invalid dependency cycle") % { module_name: @requested_module, version: v(@requested_version) }
end

Instance Method Details

#multilineObject

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.


113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/puppet/module_tool/errors/shared.rb', line 113

def multiline
  dependency_list = []
  dependency_list << _("You specified '%{name}' (%{version})") % { name: @source.first[:name], version: v(@requested_version) }
  dependency_list += @source[1..-1].map do |m|
    #TRANSLATORS This message repeats as separate lines as a list under the heading "You specified '%{name}' (%{version})\n"
    _("This depends on '%{name}' (%{version})") % { name: m[:name], version: v(m[:version]) }
  end
  message = []
  message << _("Could not install module '%{module_name}' (%{version})") % { module_name: @requested_module, version: v(@requested_version) }
  message << _("  No version of '%{module_name}' will satisfy dependencies") % { module_name: @module_name }
  message << dependency_list.map {|s| "    #{s}".join(",\n")}
  #TRANSLATORS `puppet module install --force` is a command line and should not be translated
  message << _("    Use `puppet module install --force` to install this module anyway")
  message.join("\n")
end