class KnifeTopo::Processor

Base processor

Attributes

input[RW]

Public Class Methods

for_topo(topo) click to toggle source
# File lib/chef/knife/topo/processor.rb, line 51
def self.for_topo(topo)
  processor(topo)
end
load_processor(strategy) click to toggle source
# File lib/chef/knife/topo/processor.rb, line 43
def self.load_processor(strategy)
  require "chef/knife/topo/processor/#{strategy}"
  @@processor_classes[strategy]
rescue LoadError
  STDERR.puts("#{strategy} is not a known strategy")
  exit(1)
end
new(topo) click to toggle source
# File lib/chef/knife/topo/processor.rb, line 57
def initialize(topo)
  @topo = topo
end
processor(topo) click to toggle source

Get the right processor

# File lib/chef/knife/topo/processor.rb, line 35
def self.processor(topo)
  strategy = topo.strategy
  processor_class = @@processor_classes[strategy]
  processor_class = load_processor(strategy) unless processor_class

  Object.const_get(processor_class).new(topo)
end
register_processor(strategy, class_name) click to toggle source
# File lib/chef/knife/topo/processor.rb, line 30
def self.register_processor(strategy, class_name)
  @@processor_classes[strategy] = class_name
end

Public Instance Methods

generate_artifacts(_context = {}) click to toggle source
# File lib/chef/knife/topo/processor.rb, line 68
def generate_artifacts(_context = {})
  {}
end
generate_nodes() click to toggle source
# File lib/chef/knife/topo/processor.rb, line 64
def generate_nodes
  @topo.merged_nodes
end
upload_artifacts(_context = {}) click to toggle source
# File lib/chef/knife/topo/processor.rb, line 72
def upload_artifacts(_context = {})
end