summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-07 01:16:57 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-07 01:16:57 +0000
commit7e41d436fe343103b67d7078c08c3ec444ea0aa7 (patch)
tree5caf6a631a531f583f3a1fd6028c2893f2aa3231 /lib
parent46d344b9daa24047b60183cc94509d306b6b562a (diff)
downloadpuppet-7e41d436fe343103b67d7078c08c3ec444ea0aa7.tar.gz
puppet-7e41d436fe343103b67d7078c08c3ec444ea0aa7.tar.xz
puppet-7e41d436fe343103b67d7078c08c3ec444ea0aa7.zip
Turning a failure into an error when, for some reason, pfiles do not have paths set.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2260 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/type/pfile.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb
index ffeba9f0e..60693b23a 100644
--- a/lib/puppet/type/pfile.rb
+++ b/lib/puppet/type/pfile.rb
@@ -209,10 +209,12 @@ module Puppet
# Autorequire any parent directories.
autorequire(:file) do
- unless self[:path]
- raise "no path for %s" % self.ref
+ if self[:path]
+ File.dirname(self[:path])
+ else
+ Puppet.err "no path for %s, somehow; cannot setup autorequires" % self.ref
+ nil
end
- File.dirname(self[:path])
end
# Autorequire the owner and group of the file.