Issue #6746 has been updated by Daniel Pittman.
Nigel Kersten wrote: > I agree. > > We should just drop array support for all singleton value'd attributes. It > doesn't make sense to support arrays here. Lets drop it in Statler though. Do we add a deprecation warning in 2.6 (which, nominally, the work that discovered this targets), or in 2.7, or just drop it entirely? I honestly favour the later, with a clear error, since the behaviour is already kind of crazy, so a clean and obvious failure is better than trying to second-guess someone. ---------------------------------------- Bug #6746: Exec parameters handle arrays inconsistently https://projects.puppetlabs.com/issues/6746 Author: Max Martin Status: Accepted Priority: Normal Assignee: Category: exec Target version: Statler Affected Puppet version: Keywords: Branch: Currently the timeout parameter to the exec type will accept an array as input, but the tries and try_sleep parameter do not (as noted by pending tests in the exec type spec). The way that timeout 'handles' arrays, though, is just by taking the first item from them and discarding the rest: newparam(:timeout) do desc "The maximum time the command should take. If the command takes longer than the timeout, the command is considered to have failed and will be stopped. Use any negative number to disable the timeout. The time is specified in seconds." munge do |value| value = value.shift if value.is_a?(Array) if value.is_a?(String) unless value =~ /^[-\d.]+$/ raise ArgumentError, "The timeout must be a number." end Float(value) else value end end defaultto 300 end None of this is covered in the documentation for exec (http://docs.puppetlabs.com/references/latest/type.html#exec). We either need to change the behavior of the other parameters to match this one, come up with a new, better way to handle arrays, or remove support for handling any input in arrays. My recommendation is to drop support for arrays for these parameters altogether, since our current "support" for arrays just discards everything but the first item, and all of these parameters basically support singleton arguments anyways. -- 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.
