diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/puppet/type/file/ensure.rb | 5 | ||||
-rwxr-xr-x | lib/puppet/type/file/source.rb | 20 |
2 files changed, 7 insertions, 18 deletions
diff --git a/lib/puppet/type/file/ensure.rb b/lib/puppet/type/file/ensure.rb index 0d2171216..a9ddc2dba 100755 --- a/lib/puppet/type/file/ensure.rb +++ b/lib/puppet/type/file/ensure.rb @@ -138,11 +138,6 @@ module Puppet # We have to treat :present specially, because it works with any # type of file. def insync?(currentvalue) - if property = @resource.property(:source) and ! property.described? - warning "No specified sources exist" - return true - end - if self.should == :present if currentvalue.nil? or currentvalue == :absent return false diff --git a/lib/puppet/type/file/source.rb b/lib/puppet/type/file/source.rb index 1b0dd3141..f2704abb6 100755 --- a/lib/puppet/type/file/source.rb +++ b/lib/puppet/type/file/source.rb @@ -135,18 +135,8 @@ module Puppet return args end - # Have we successfully described the remote source? - def described? - ! @stats.nil? and ! @stats[:type].nil? #and @is != :notdescribed - end - # Use the info we get from describe() to check if we're in sync. def insync?(currentvalue) - unless described? - warning "No specified sources exist" - return true - end - if currentvalue == :nocopy return true end @@ -180,7 +170,11 @@ module Puppet def pinparams [:mode, :type, :owner, :group] end - + + def found? + ! (@stats.nil? or @stats[:type].nil?) + end + # This basically calls describe() on our file, and then sets all # of the local states appropriately. If the remote file is a normal # file then we set it to copy; if it's a directory, then we just mark @@ -202,8 +196,8 @@ module Puppet } end - if @stats.nil? or @stats[:type].nil? - return nil # :notdescribed + if !found? + raise Puppet::Error, "No specified source was found from" + @should.inject("") { |s, source| s + " #{source},"}.gsub(/,$/,"") end case @stats[:type] |