Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PUP-2306) Force return type of generate to String #2559

Conversation

zaphod42
Copy link
Contributor

When Puppet::Util::Execution.execute was changed to return a subtype of
String in order to retain return code information, some callers ended up
breaking. This is because they made the assertion that types were exactly the
String class, rather than a subtype of String. There is also the issue that
only the primitive data structures should probably be returned from puppet
functions in order to not leak complex objects into the puppet language and
have hard to track down issues arise.

This changes the generate() function to force it to return a String of the
command's output.

When Puppet::Util::Execution.execute was changed to return a subtype of
String in order to retain return code information, some callers ended up
breaking. This is because they made the assertion that types were
exactly the String class, rather than a subtype of String. There is also
the issue that only the primitive data structures should probably be
returned from puppet functions in order to not leak complex objects into
the puppet language and have hard to track down issues arise.

This changes the generate() function to force it to return a String of
the command's output.
@puppetcla
Copy link

CLA signed by all contributors.

hlindberg added a commit that referenced this pull request Apr 24, 2014
…-returns-strings

(PUP-2306) Force return type of generate to String
@hlindberg hlindberg merged commit 6db89c3 into puppetlabs:master Apr 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants