From f99b1dee70b6c595c765f69148d2fbd937a86cae Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Thu, 31 Jan 2013 17:50:57 -0700 Subject: [PATCH] Update Percona::WebAPI::Representation in pt-agent so the previous commit actually works. --- bin/pt-agent | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/pt-agent b/bin/pt-agent index 788463f0..2b12d089 100755 --- a/bin/pt-agent +++ b/bin/pt-agent @@ -714,9 +714,14 @@ sub as_json { $json->allow_blessed([]); $json->convert_blessed([]); - return $json->encode( + my $text = $json->encode( ref $resource eq 'ARRAY' ? $resource : as_hashref($resource, %args) ); + if ( $args{json} && $text ) { # for testing + chomp($text); + $text .= "\n"; + } + return $text; } sub as_config {