Class: Chef::PartialRun
- Defined in:
- lib/garcon/chef/provider/partial.rb
Instance Method Summary collapse
-
#clean_attrs ⇒ Object
Clean the node data.
-
#initialize(partial, attributes = nil, arguments = {}) ⇒ PartialRun
constructor
A new instance of PartialRun.
- #partial_run(run_list) ⇒ Object
- #run_completed_successfully ⇒ Object
Constructor Details
#initialize(partial, attributes = nil, arguments = {}) ⇒ PartialRun
Returns a new instance of PartialRun.
91 92 93 94 |
# File 'lib/garcon/chef/provider/partial.rb', line 91 def initialize(partial, attributes = nil, arguments = {}) super(attributes, arguments) @partial = partial end |
Instance Method Details
#clean_attrs ⇒ Object
Clean the node data
118 119 120 121 122 |
# 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) ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# 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 ⇒ Object
124 125 126 |
# File 'lib/garcon/chef/provider/partial.rb', line 124 def run_completed_successfully # do nothing end |