Report abuse


			
    # Parse the existing file.
    def self.parse(file)
        unless file =~ /-([^-]+)$/
            Puppet.warning "Could not extract interface name from %s; skipping" % file
            return nil
        end
        name = $1
        instance = new(:name => name)
        return instance unless FileTest.exist?(file)

        File.readlines(file).each do |line|
            if line =~ /^(\w+)=(.+)$/
                method = $1.downcase + "="
                instance.send(method, $2) if instance.respond_to?(method)
            end
        end

        return instance
    end