You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(GH-1759) Strip non-UTF-8 characters from command/script results
We explicitly fail if a task returns non-UTF-8 characters, but those
characters are generally allowed from commands and scripts. However,
they still can't be printed or converted to JSON. We now define a
"safe_value" that is the scrubbed version of the input and use that for
printing and JSON.
This commit removes the status_hash method and replaces it in all cases with
the to_data method which is otherwise identical except for having string
keys. The to_data method now returns the safe_value, as to_data is only
used to print the result, deal with it as JSON equivalent in Puppet, or
emit it as JSON. Each of those cases requires it to be UTF-8 only.
!bug
* **Non-UTF-8 characters in command and script output are removed before printing**
([#1759](#1759))
Commands and scripts are allowed to return UTF-8, but Bolt would error
when trying to print those results or return them as JSON. Now,
accessing fields of the result from a Puppet plan will return the
values unmodified, but invalid characters will be replaced by their
hex-escaped equivalents when printing the result or converting it to
JSON.
0 commit comments