diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-15 15:27:49 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-15 15:27:49 +0000 |
commit | e841d8fafac51837b13c3f429d988944aaba2119 (patch) | |
tree | f9b6f43c49ea33fdbf85bf1d52eafe79e29fc5a3 | |
parent | 6ef3d88110fd44b51733d03ff01f5f84aa327fb7 (diff) | |
download | puppet-e841d8fafac51837b13c3f429d988944aaba2119.tar.gz puppet-e841d8fafac51837b13c3f429d988944aaba2119.tar.xz puppet-e841d8fafac51837b13c3f429d988944aaba2119.zip |
Adding test and fix for empty execs being ignored
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1288 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r-- | examples/code/snippets/emptyexec.pp | 2 | ||||
-rw-r--r-- | lib/puppet/parser/scope.rb | 8 | ||||
-rwxr-xr-x | test/language/snippets.rb | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/examples/code/snippets/emptyexec.pp b/examples/code/snippets/emptyexec.pp new file mode 100644 index 000000000..fdd8751f6 --- /dev/null +++ b/examples/code/snippets/emptyexec.pp @@ -0,0 +1,2 @@ +exec { "/bin/touch /tmp/emptyexectest": +} diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb index b5f91a4f9..b607bb081 100644 --- a/lib/puppet/parser/scope.rb +++ b/lib/puppet/parser/scope.rb @@ -999,9 +999,11 @@ module Puppet::Parser child.class end - # Skip empty builtin types or defined types - if result and ! result.empty? - results << result + # Skip nil objects or empty transbuckets + if result + unless result.is_a? Puppet::TransBucket and result.empty? + results << result + end end end diff --git a/test/language/snippets.rb b/test/language/snippets.rb index 1e7b86968..2823f89ad 100755 --- a/test/language/snippets.rb +++ b/test/language/snippets.rb @@ -469,6 +469,8 @@ class TestSnippets < Test::Unit::TestCase def snippet_emptyexec(trans) assert(FileTest.exists?("/tmp/emptyexectest"), "Empty exec was ignored") + + @@tmpfiles << "/tmp/emptyexextest" end def disabled_snippet_dirchmod(trans) |