class Chef::PartialRun

Public Class Methods

new(partial, attributes = nil, arguments = {}) click to toggle source
Calls superclass method
# File lib/garcon/chef/provider/partial.rb, line 91
def initialize(partial, attributes = nil, arguments = {})
  super(attributes, arguments)
  @partial = partial
end

Public Instance Methods

clean_attrs() click to toggle source

Clean the node data

# File lib/garcon/chef/provider/partial.rb, line 118
def clean_attrs
  data = node.to_hash
  %w(run_list recipes roles).each { |k| data.delete(k) }
  data
end
partial_run(run_list) click to toggle source
# File lib/garcon/chef/provider/partial.rb, line 96
def partial_run(run_list)
  cache_path = file_cache_path
  begin
    digest = Digest::MD5.hexdigest(@partial)
    Chef::Config[:file_cache_path] = file_cache_path("partial-#{digest}")
    run_ohai
    register unless Chef::Config[:solo]
    load_node
    run_list_items = run_list.split(',').collect do |item|
      Chef::RunList::RunListItem.new(item)
    end
    node.run_list(*run_list_items)
    build_node
    run_context = setup_run_context
    converge(run_context)
  ensure
    Chef::Config[:file_cache_path] = cache_path
  end
end
run_completed_successfully() click to toggle source
# File lib/garcon/chef/provider/partial.rb, line 124
def run_completed_successfully
  # do nothing
end