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

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

Instance Method Summary collapse

Methods inherited from ModuleToolError

#v, #vstring

Constructor Details

#initialize(options) ⇒ InvalidDependencyCycleError

Returns a new instance of InvalidDependencyCycleError.



33
34
35
36
37
38
39
40
41
# File 'lib/vendor/puppet/module_tool/errors/shared.rb', line 33

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 "'#{@requested_module}' (#{v(@requested_version)}) requested; Invalid dependency cycle"
end

Instance Method Details

#multilineObject



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/vendor/puppet/module_tool/errors/shared.rb', line 43

def multiline
  trace = []
  trace << "You specified '#{@source.first[:name]}' (#{v(@requested_version)})"
  trace += @source[1..-1].map { |m| "which depends on '#{m[:name]}' (#{v(m[:version])})" }

  message = []
  message << "Could not install module '#{@requested_module}' (#{v(@requested_version)})"
  message << "  No version of '#{@module_name}' will satisfy dependencies"
  message << trace.map { |s| "    #{s}" }.join(",\n")
  message << "    Use `puppet module install --force` to install this module anyway"

  message.join("\n")
end