Issue #3753 has been updated by Nigel Kersten.

Oh, I accidentally showed the version with the path set. If you don't set a 
path, like:

<pre>

$testvar="one"

exec { "foo":
  command => $testvar ? {
    "woot"  => "/bin/echo woot",
    default => undef,
  }
}
</pre>

results in:

<pre>
'foo' is both unqualifed and specified no search path at /tmp/test.pp:9
</pre>

Which is also misleading.
----------------------------------------
Bug #3753: Exec commands can't be undef
http://projects.puppetlabs.com/issues/3753

Author: Nigel Kersten
Status: Unreviewed
Priority: Normal
Assigned to: 
Category: 
Target version: 
Affected version: 0.25.4
Keywords: 
Branch: 


I'm not 100% convinced this is a bug, it may be a feature request or it may be 
a dumb idea.

You can't 'undef' an Exec command currently, I discovered this when one of my 
staff did:

<pre>
$testvar="one"

exec { "foo":
  path => "/bin",
  command => $testvar ? {
    "woot"  => "/bin/echo woot",
    default => undef,
  }
}
</pre>
results in:

<pre>
debug: //Exec[foo]: Changing returns
debug: //Exec[foo]: 1 change(s)
debug: //Exec[foo]: Executing 'foo'
debug: Executing 'foo'
err: //Exec[foo]/returns: change from notrun to 0 failed: foo returned 1 
instead of one of [0] at /tmp/test.pp:10
</pre>

I'm unsure what the correct behavior is here, but at the least I feel like a 
better error message might be in order.


-- 
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.

Reply via email to