diff --git a/lib/puppet/type/file/ctime.rb b/lib/puppet/type/file/ctime.rb index 90d95da64..5f94863b4 100644 --- a/lib/puppet/type/file/ctime.rb +++ b/lib/puppet/type/file/ctime.rb @@ -1,18 +1,18 @@ module Puppet Puppet::Type.type(:file).newproperty(:ctime) do desc "A read-only state to check the file ctime." def retrieve current_value = :absent if stat = @resource.stat current_value = stat.ctime end current_value end - validate do + validate do |val| fail "ctime is read-only" end end end diff --git a/lib/puppet/type/file/mtime.rb b/lib/puppet/type/file/mtime.rb index 5952b4b84..10867ddf4 100644 --- a/lib/puppet/type/file/mtime.rb +++ b/lib/puppet/type/file/mtime.rb @@ -1,17 +1,17 @@ module Puppet Puppet::Type.type(:file).newproperty(:mtime) do desc "A read-only state to check the file mtime." def retrieve current_value = :absent if stat = @resource.stat current_value = stat.mtime end current_value end - validate do + validate do |val| fail "mtime is read-only" end end end diff --git a/lib/puppet/type/file/type.rb b/lib/puppet/type/file/type.rb index 864d3b1a4..38f301573 100755 --- a/lib/puppet/type/file/type.rb +++ b/lib/puppet/type/file/type.rb @@ -1,19 +1,19 @@ module Puppet Puppet::Type.type(:file).newproperty(:type) do require 'etc' desc "A read-only state to check the file type." def retrieve current_value = :absent if stat = @resource.stat current_value = stat.ftype end current_value end - validate do + validate do |val| fail "type is read-only" end end end