summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet')
-rwxr-xr-xlib/puppet/type/exec.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb
index a7d637e57..6fec43520 100755
--- a/lib/puppet/type/exec.rb
+++ b/lib/puppet/type/exec.rb
@@ -128,6 +128,12 @@ module Puppet
self.checkexe
+ if cwd = self.parent[:cwd]
+ unless File.directory?(cwd)
+ self.fail "Working directory '%s' does not exist" % cwd
+ end
+ end
+
# We need a dir to change to, even if it's just the cwd
dir = self.parent[:cwd] || Dir.pwd
tmppath = ENV["PATH"]
@@ -248,10 +254,6 @@ module Puppet
if dir.is_a?(Array)
dir = dir[0]
end
-
- unless File.directory?(dir)
- self.fail "Directory '%s' does not exist" % dir
- end
dir
end
@@ -391,6 +393,7 @@ module Puppet
validatecmd(self[:command])
end
+ # FIXME exec should autorequire any exec that 'creates' our cwd
autorequire(:file) do
reqs = []