Issue #19697 has been updated by Charlie Sharpsteen.

Thanks for digging deeper on this! I think my eyes were rolling back in my head 
by the time I got to #4884, so I missed that passing command arrays is actual 
implemented behavior and not just more exec array weirdness or a pending 
feature request. Will follow up in #19711 and #19713.
----------------------------------------
Bug #19697: giving an array as the command parameter of exec throws an obscure 
error
https://projects.puppetlabs.com/issues/19697#change-86980

Author: jared jennings
Status: Duplicate
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 2.7.18
Keywords: 
Branch: 


It's probably quite silly to try to give multiple commands to one exec 
resource. But giving an array as the value for a parameter frequently works, 
and I wasn't paying a lot of attention. When I tried to give an array as the 
value of command for an exec resource, it took me a good ten minutes to track 
down what had happened, because I got only this error:

    err: Got an uncaught exception of type NoMethodError: private method `scan' 
called for #<Array:0x7f11f3bebbd8>

Furthermore, the puppet agent said, "Finished catalog run," rather than 
failing, and I'm not sure whether it actually finished or not. And my manifest 
passed through `puppet parser validate` with no errors.

I think that when I give multiple values for the command parameter of an exec 
resource, either it should work or it should cause a parse error.

I found this problem while running Puppet 2.7.18; but a look at the code in the 
master branch on Github suggests it may act the same way.

`--trace` revealed that the offending call to the scan method was on line 447 
of type/exec.rb, where we're autorequiring files named in the value of the 
command parameter (`self[:command].scan(file_regex) ...`); but I expect that if 
one were to cause a parse error, it would be by adding a validate block to the 
`newparam(:command)`, around line 132 of type/exec.rb.


-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to