When we pass an empty string the current to_yaml() function generates
broken YAML such as "--- ''", which then breaks code parsing that
expecting valid YAML. If we pass an empty string, return an empty string
as well.
(cherry picked from commit ae2d6e6ed2)
(cherry picked from commit 81a79af51e)
Change-Id: I8743bed2ca9888409a2f74fa0012f65b7b307e21