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

Returns a new instance of InvalidDependencyCycleError.



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

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



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

def multiline
  trace = []
  trace << _("You specified '%{name}' (%{version})") % { name: @source.first[:name], version: v(@requested_version) }
  #TRANSLATORS Second half of "You specified a module..."
  trace += @source[1..-1].map { |m| _("which depends on '%{name}' (%{version})") % { name: m[:name], version: v(m[:version]) } }

  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 << trace.map { |s| "    #{s}".join(",\n") }
  message << _("    Use `puppet module install --force` to install this module anyway")

  message.join("\n")
end