Issue #22592 has been reported by Igor Berger.

----------------------------------------
Bug #22592: "exec" resource  "returns" attribute misparsed with --parser=future
https://projects.puppetlabs.com/issues/22592

* Author: Igor Berger
* Status: Unreviewed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 3.2.4
* Keywords: 
* Branch: 
----------------------------------------
Running Puppet agent stand-alone on Windows.

Start calc.exe, then this command to kill it succeeds:

<pre>
puppet apply -e "exec { 'kill_without_future': path => $::path, command => 
'powershell stop-process -force -name calc', returns => [0, 1] }"
</pre>

Start calc.exe again, then add --parser=future to the command:

<pre>
puppet apply --parser=future -e "exec { 'kill_future_unquoted': path => 
$::path, command => 'powershell stop-process -force -name calc', returns => [0, 
1] }"
</pre>

This fails (even though calc.exe is killed):

<pre>
Error: powershell stop-process -force -name calc returned 0 instead of one of 
[00,1]
Error: /Stage[main]//Exec[kill_future_unquoted]/returns: change from notrun to 
00 1 failed:
powershell stop-process -force -name calc returned 0 instead of one of [00,1]
</pre>

Start calc.exe again, but now quote the return values. It succeeds again:

<pre>
puppet apply --parser=future -e "exec { 'kill_future_quoted': path => $::path, 
command => 'powershell stop-process -force -name calc', returns => ['0', '1'] }"
</pre>

I expect that the process exit codes are numbers and don't need to be quoted in 
the "returns" attribute.

The problem is reproducible on Puppet 3.2.4 and 3.3.0.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to