Sha256: 32c69aaf19397f7e20bb33d3066f04f1beac3f1075d20e3f4abf827f27833d93

Contents?: true

Size: 644 Bytes

Versions: 1

Compression:

Stored size: 644 Bytes

Contents

module Puppet
    Puppet.type(:file).newproperty(:type) do
        require 'etc'
        desc "A read-only state to check the file type."

        #munge do |value|
        #    raise Puppet::Error, ":type is read-only"
        #end
        
        def retrieve
            if stat = @parent.stat(false)
                @is = stat.ftype
            else
                @is = :absent
            end

            # so this state is never marked out of sync
            @should = [@is]
        end


        def sync
            raise Puppet::Error, ":type is read-only"
        end
    end
end

# $Id: type.rb 2169 2007-02-07 06:47:10Z luke $

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
puppet-0.22.4 lib/puppet/type/pfile/type.rb