logadm/lib/puppet/type/logadm.rb
def remove_entry
            tmpfile = Tempfile.new('puppet-logadm')
            File.open(self[:conf_file]).each_line do |line|
                # Skip the line implementing the entry itself
                unless line.match(/#{self[:name]}\s/)
                    # Skip the formatted comment for the entry
                    unless line.match(/^#.* puppet\(logadm\["#{self[:name]}"\]\)\s*$/)
                        tmpfile.puts line
                    end
                end
            end
            tmpfile.close
            FileUtils.copy(tmpfile.path, self[:conf_file])
            tmpfile.unlink
        end
# Remove this resource from the logadm.conf file.
Remove this resource from the logadm.conf file.
Remove this resource from the logadm . conf file .
def remove_entry
            tmpfile = Tempfile.new('puppet-logadm')
            File.open(self[:conf_file]).each_line do |line|
                unless line.match(/#{self[:name]}\s/)
                    unless line.match(/^#.* puppet\(logadm\["#{self[:name]}"\]\)\s*$/)
                        tmpfile.puts line
                    end
                end
            end
            tmpfile.close
            FileUtils.copy(tmpfile.path, self[:conf_file])
            tmpfile.unlink
        end
def remove_entry tmpfile = Tempfile . new ( 'puppet-logadm' ) File . open ( self [ :conf_file ] ) . each_line do | line | unless line . match ( / #{ self [ :name ] } \s / ) unless line . match ( / ^#.* puppet \( logadm \[ " #{ self [ :name ] } " \] \) \s *$ / ) tmpfile . puts line end end end tmpfile . close FileUtils . copy ( tmpfile . path , self [ :conf_file ] ) tmpfile . unlink end
Remove this resource from the logadm.conf file.
Remove this resource from the logadm . conf file .
# Skip the line implementing the entry itself # Skip the formatted comment for the entry