Issue #4288 has been updated by James Turnbull.
After some more debugging I don't think it's linked to #4233 - however with
that patched I run the following:
<pre>
exec { 'foo':
command => 'if [ "abc" != "def" ]; then echo "this is a test"; fi',
logoutput => true
}
</pre>
and get:
<pre>
puppet --trace --debug --verbose /tmp/4288.pp
/usr/lib/ruby/site_ruby/1.8/puppet/util/errors.rb:60:in `fail'
/usr/lib/ruby/site_ruby/1.8/puppet/type/exec.rb:673:in `validatecmd'
/usr/lib/ruby/site_ruby/1.8/puppet/type/exec.rb:481:in `validate'
/usr/lib/ruby/site_ruby/1.8/puppet/type.rb:1726:in `initialize'
/usr/lib/ruby/site_ruby/1.8/puppet/resource.rb:248:in `new'
/usr/lib/ruby/site_ruby/1.8/puppet/resource.rb:248:in `to_ral'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:553:in `send'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:553:in `to_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:531:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:531:in `to_catalog'
/usr/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:468:in `to_ral'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:115:in `main'
/usr/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:35:in `run_command'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:301:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:398:in `exit_on_fail'
/usr/lib/ruby/site_ruby/1.8/puppet/application.rb:301:in `run'
/usr/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:55:in `execute'
/usr/bin/puppet:4
'if [ "abc" != "def" ]; then echo "this is a test"; fi' is both unqualifed and
specified no search path at /tmp/4288.pp:5
</pre>
----------------------------------------
Bug #4288: Error if exec command starts with shell built-in like "if"
http://projects.puppetlabs.com/issues/4288
Author: Alan Harder
Status: Accepted
Priority: Normal
Assigned to:
Category: exec
Target version: 2.6.0
Affected version: 2.6.0rc4
Keywords:
Branch:
<pre>exec { 'foo':
command => 'if [ "abc" != "def" ]; then echo "this is a test"; fi',
logoutput => true
}</pre>
With the above test case on 2.6.0rc4 (on Solaris 10 with ruby 1.8.7) I get:
<pre>err: /Stage[main]//Node[...]/Exec[foo]/returns: change from notrun to 0
failed: Could not find executable 'no if in /usr/bin /usr/sbin'</pre>
A command like this worked in 0.25.5.. is the behavior change intentional, or
is this a bug?
Side node: if I add whitespace at the front (command => ' if [ .....') then the
error says *Could not find command ''*
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.