summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-09-16 11:41:48 -0500
committerLuke Kanies <luke@madstop.com>2008-09-16 11:41:48 -0500
commita1a670b305252b2f4b4b2b0020303143addc3eb8 (patch)
treef64c80cc62941670dd2a4c12d88a99e5e24dd49d /lib
parentdd4f65478c23eaeb56dcef588f96bfdd31557080 (diff)
downloadpuppet-a1a670b305252b2f4b4b2b0020303143addc3eb8.tar.gz
puppet-a1a670b305252b2f4b4b2b0020303143addc3eb8.tar.xz
puppet-a1a670b305252b2f4b4b2b0020303143addc3eb8.zip
Fixed #1572 -- file purging now fails if remote sources do not exist.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/type/file.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb
index 3518e8bb3..875f8c370 100644
--- a/lib/puppet/type/file.rb
+++ b/lib/puppet/type/file.rb
@@ -849,6 +849,8 @@ module Puppet
# Keep track of all the files we found in the source, so we can purge
# appropriately.
sourced = []
+
+ success = false
@parameters[:source].should.each do |source|
sourceobj, path = uri2obj(source)
@@ -863,6 +865,8 @@ module Puppet
if desc == ""
next
end
+
+ success = true
# Now create a new child for every file returned in the list.
result += desc.split("\n").collect { |line|
@@ -898,6 +902,11 @@ module Puppet
return [result, sourced]
end
end
+
+ unless success
+ raise Puppet::Error, "None of the provided sources exist"
+ end
+
return [result, sourced]
end