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

Inherits:
ModuleToolError show all
Defined in:
lib/puppet/module_tool/errors/shared.rb

Instance Attribute Summary

Attributes inherited from Error

#original

Instance Method Summary collapse

Methods inherited from ModuleToolError

#v, #vstring

Constructor Details

#initialize(options) ⇒ InvalidDependencyCycleError


88
89
90
91
92
93
94
95
96
# File 'lib/puppet/module_tool/errors/shared.rb', line 88

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


98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/puppet/module_tool/errors/shared.rb', line 98

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