HomePhorge

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

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
Michael Stahnke <stahnma@puppetlabs.com>Committed on Oct 13 2011, 10:55 PM
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUbedf7d2f4f56: Updated CHANGELOG for 2.7.6rc2
Branches
Unknown
Tags
Unknown

Event Timeline

Michael Stahnke <stahnma@puppetlabs.com> committed rPU43d1e389d83c: (#9996) Restore functionality for multi-line commands in exec resources (authored by Jacob Helwig <jacob@puppetlabs.com>).Oct 13 2011, 10:55 PM