diff options
author | Andrew Shafer <andrew@reductivelabs.com> | 2008-07-14 19:54:52 -0600 |
---|---|---|
committer | Andrew Shafer <andrew@reductivelabs.com> | 2008-07-14 19:54:52 -0600 |
commit | 4ce7159baba4c637867c91519b5a3b16627dfca5 (patch) | |
tree | 6db7b423ed490deca8858caecce3bff5d09784d7 | |
parent | 4c5293b837807f61002365114fd7004d2f74ad57 (diff) | |
download | puppet-4ce7159baba4c637867c91519b5a3b16627dfca5.tar.gz puppet-4ce7159baba4c637867c91519b5a3b16627dfca5.tar.xz puppet-4ce7159baba4c637867c91519b5a3b16627dfca5.zip |
Fail instead of log when rescuing remote file connections
Issue 1397
one line fix, very simple
-rw-r--r-- | CHANGELOG | 2 | ||||
-rwxr-xr-x | lib/puppet/type/file/source.rb | 3 | ||||
-rwxr-xr-x | spec/unit/type/file.rb | 5 |
3 files changed, 8 insertions, 2 deletions
@@ -1,4 +1,6 @@ 0.24.5 + Fixed #1397 One line fix, fail instead of log + Moved debian to conf and updated examples directory Fixed #1368 - updated Red Hat init scripts diff --git a/lib/puppet/type/file/source.rb b/lib/puppet/type/file/source.rb index f2704abb6..2514d3d1e 100755 --- a/lib/puppet/type/file/source.rb +++ b/lib/puppet/type/file/source.rb @@ -101,8 +101,7 @@ module Puppet begin desc = server.describe(path, @resource[:links]) rescue Puppet::Network::XMLRPCClientError => detail - self.err "Could not describe %s: %s" % [path, detail] - return nil + fail detail, "Could not describe %s: %s" % [path, detail] end return nil if desc == "" diff --git a/spec/unit/type/file.rb b/spec/unit/type/file.rb index f0ae70cd0..3ea4c3731 100755 --- a/spec/unit/type/file.rb +++ b/spec/unit/type/file.rb @@ -64,6 +64,11 @@ describe Puppet::Type.type(:file) do @file.property(:source).retrieve lambda { @file.property(:source).sync }.should raise_error(Puppet::Error) end + + it "should fail if it cannot describe remote contents" do + @filesource.server.stubs(:describe).raises(Puppet::Network::XMLRPCClientError.new("Testing")) + lambda { @file.retrieve }.should raise_error(Puppet::Error) + end end describe "when managing links" do |