Method: Chef::Node#consume_run_list
- Defined in:
- lib/chef/node.rb
#consume_run_list(attrs) ⇒ Object
Extracts the run list from attrs and applies it. Returns the remaining attributes
435 436 437 438 439 440 441 442 443 444 445 446 |
# File 'lib/chef/node.rb', line 435 def consume_run_list(attrs) attrs = attrs ? attrs.dup : {} if new_run_list = attrs.delete("recipes") || attrs.delete("run_list") if attrs.key?("recipes") || attrs.key?("run_list") raise Chef::Exceptions::AmbiguousRunlistSpecification, "please set the node's run list using the 'run_list' attribute only." end logger.info("Setting the run_list to #{new_run_list} from CLI options") run_list(new_run_list) end attrs end |