# File lib/chef/provider/route.rb, line 130
    def generate_config
      conf = Hash.new
      case node[:platform]
      when ("centos" || "redhat" || "fedora")
        # walk the collection
        run_context.resource_collection.each do |resource|
          if resource.is_a? Chef::Resource::Route
            # default to eth0
            if resource.device
              dev = resource.device
            else
              dev = "eth0"
            end

            conf[dev] = String.new if conf[dev].nil?
            if resource.action == :add
              conf[dev] = config_file_contents(:add, :target => resource.target, :netmask => resource.netmask, :gateway => resource.gateway)
            else
              # need to do this for the case when the last route on an int
              # is removed
              conf[dev] = config_file_contents(:delete)
            end
          end
        end
        conf.each do |k, v|
          network_file = ::File.new("/etc/sysconfig/network-scripts/route-#{k}", "w")
          network_file.puts(conf[k])
          Chef::Log.debug("#{@new_resource} writing route.#{k}\n#{conf[k]}")
          network_file.close
        end
      end
    end