lib/chef/policy_builder/expand_node_object.rb
# Applies environment, external JSON attributes, and override run list to
# the node, Then expands the run_list.
#
# === Returns
# node<Chef::Node>:: The modified node object. node is modified in place.
Applies environment, external JSON attributes, and override run list to
the node, Then expands the run_list.

Returns
node:: The modified node object. node is modified in place.
Applies environment external JSON attributes and override run list to the node Then expands the run_list . Returns node :: The modified node object . node is modified in place .
def build_node
        if Chef::Config[:environment] && !Chef::Config[:environment].chomp.empty?
          node.chef_environment(Chef::Config[:environment])
        end
        node.reset_defaults_and_overrides
        node.consume_external_attrs(ohai_data, @json_attribs)
        setup_run_list_override
        expand_run_list
        Chef::Log.info("Run List is [#{node.run_list}]")
        Chef::Log.info("Run List expands to [#{@expanded_run_list_with_versions.join(', ')}]")
        events.node_load_completed(node, @expanded_run_list_with_versions, Chef::Config)
        node
      end
def build_node if Chef :: Config [ :environment ] && ! Chef :: Config [ :environment ] . chomp . empty? node . chef_environment ( Chef :: Config [ :environment ] ) end node . reset_defaults_and_overrides node . consume_external_attrs ( ohai_data , @json_attribs ) setup_run_list_override expand_run_list Chef :: Log . info ( "Run List is [#{node.run_list}]" ) Chef :: Log . info ( "Run List expands to [#{@expanded_run_list_with_versions.join(', ')}]" ) events . node_load_completed ( node , @expanded_run_list_with_versions , Chef :: Config ) node end
Applies environment, external JSON attributes, and override run list to
the node, Then expands the run_list.
Applies environment external JSON attributes and override run list to the node Then expands the run_list .
# Allow user to override the environment of a node by specifying # a config parameter. # consume_external_attrs may add items to the run_list. Save the # expanded run_list, which we will pass to the server later to # determine which versions of cookbooks to use.