summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-01-19 14:34:20 -0600
committerLuke Kanies <luke@madstop.com>2008-01-19 14:34:20 -0600
commit2cbab2c6916d6bd7c5ad01b137b3469eeea8d3e4 (patch)
tree30d292724c945bfdba7aacd0b386b1ef4196f937
parentf5674cd527defd2db9165fdc3d7f966a43b70b75 (diff)
downloadpuppet-2cbab2c6916d6bd7c5ad01b137b3469eeea8d3e4.tar.gz
puppet-2cbab2c6916d6bd7c5ad01b137b3469eeea8d3e4.tar.xz
puppet-2cbab2c6916d6bd7c5ad01b137b3469eeea8d3e4.zip
Fixing #1008 -- Puppet no longer throws an exception
when you've pointed a file at a source that doesn't exist and you specify 'ensure'.
-rwxr-xr-xlib/puppet/type/pfile/ensure.rb5
-rwxr-xr-xlib/puppet/type/pfile/source.rb4
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/puppet/type/pfile/ensure.rb b/lib/puppet/type/pfile/ensure.rb
index 0a6f73d95..3aa918f65 100755
--- a/lib/puppet/type/pfile/ensure.rb
+++ b/lib/puppet/type/pfile/ensure.rb
@@ -136,6 +136,11 @@ 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/pfile/source.rb b/lib/puppet/type/pfile/source.rb
index 1849d5a61..3dfb5cccd 100755
--- a/lib/puppet/type/pfile/source.rb
+++ b/lib/puppet/type/pfile/source.rb
@@ -138,10 +138,10 @@ module Puppet
# Use the info we get from describe() to check if we're in sync.
def insync?(currentvalue)
unless described?
- info "No specified sources exist"
+ warning "No specified sources exist"
return true
end
-
+
if currentvalue == :nocopy
return true
end