HomePhorge

(#9996) Restore functionality for multi-line commands in exec resources
424379dfa857Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#9996) Restore functionality for multi-line commands in exec resources

Originally we were relying on the behavior that Array.new would call
#to_a on its argument, which is a no-op if the object is already an
array. When #to_a is called on a string, it does not always return
[original_string]. Because string.to_a is effectively equivalent to
string.each_line.to_a (at least in Ruby 1.8.7) we were breaking
commands with embedded newlines.

Manually wrapping the passed in command in an array, and calling
#flatten is much safer since it will not "helpfully" split up the
command string for us.

Details

Provenance
Jacob Helwig <jacob@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU5e3962c5b149: Merge remote-tracking branch 'stschulte/ticket/2.7.x/9796' into 2.7.x
Branches
Unknown
Tags
Unknown

Event Timeline

Jacob Helwig <jacob@puppetlabs.com> committed rPU424379dfa857: (#9996) Restore functionality for multi-line commands in exec resources (authored by Jacob Helwig <jacob@puppetlabs.com>).Oct 12 2011, 10:35 PM