class Kafo::MigrationContext

Attributes

answers[RW]
scenario[RW]

Public Class Methods

execute(scenario, answers, &migration) click to toggle source
# File lib/kafo/migration_context.rb, line 6
def self.execute(scenario, answers, &migration)
  context = new(scenario, answers)
  context.instance_eval(&migration)
  return context.scenario, context.answers
end
new(scenario, answers) click to toggle source
# File lib/kafo/migration_context.rb, line 12
def initialize(scenario, answers)
  @scenario = scenario
  @answers = answers
end

Private Class Methods

facter_path() click to toggle source
# File lib/kafo/migration_context.rb, line 33
def self.facter_path
  @facter_path ||= PuppetCommand.search_puppet_path('facter')
end
facts() click to toggle source
# File lib/kafo/migration_context.rb, line 27
def self.facts
  @facts ||= begin
    YAML.load(%x`#{facter_path} --yaml`).inject({}) { |facts,(k,v)| facts.update(k.to_sym => v) }
  end
end

Public Instance Methods

facts() click to toggle source
# File lib/kafo/migration_context.rb, line 21
def facts
  self.class.facts
end
logger() click to toggle source
# File lib/kafo/migration_context.rb, line 17
def logger
  KafoConfigure.logger
end