def update_node(node_updates, merge = false)
      config[:disable_editing] = true

      begin
        # load then update and save the node
        node = Chef::Node.load(node_updates['name'])

        env = node_updates['chef_environment']
        check_chef_env(env) unless env == node['chef_environment']
        do_node_updates(node, node_updates, merge)

      rescue Net::HTTPServerException => e
        raise unless e.to_s =~ /^404/
        # Node has not been created
      end

      node
    end
def update_node(node_updates, merge = false)
      config[:disable_editing] = true

      begin
        # load then update and save the node
        node = Chef::Node.load(node_updates['name'])

        env = node_updates['chef_environment']
        check_chef_env(env) unless env == node['chef_environment']
        do_node_updates(node, node_updates, merge)

      rescue Net::HTTPServerException => e
        raise unless e.to_s =~ /^404/
        # Node has not been created
      end

      node
    end
Update an existing node