Skip to content

Commit

Permalink
MT#61052 NGCP::Template::Plugin::Utils: Do not generate bogus YAML on…
Browse files Browse the repository at this point in the history
… empty string

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.

Change-Id: I010cd9d544bd505446f0016ecc6302a987921570
  • Loading branch information
guillemj committed Nov 7, 2024
1 parent 2eb90b3 commit ae2d6e6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/NGCP/Template/Plugin/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ sub to_config_general {

sub to_yaml {
my ($self, @params) = @_;
return q{} unless $params[0];
return YAML::XS::Dump($params[0]);
}

Expand Down

0 comments on commit ae2d6e6

Please sign in to comment.