From f28d0dcfba975ea69acf848979b30bfdd9911765 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 21 Dec 2011 08:55:53 +0100 Subject: [PATCH] correctly print string return values --- bin/pvesh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/pvesh b/bin/pvesh index cf840034..7500ad5f 100755 --- a/bin/pvesh +++ b/bin/pvesh @@ -224,8 +224,16 @@ sub call_method { warn "200 OK\n"; # always print OK status if successful - return if $info && $info->{returns} && - $info->{returns}->{type} && $info->{returns}->{type} eq 'null'; + if ($info && $info->{returns} && $info->{returns}->{type}) { + my $rtype = $info->{returns}->{type}; + + return if $rtype eq 'null'; + + if ($rtype eq 'string') { + print $data; + return $data; + } + } print to_json($data, {allow_nonref => 1, canonical => 1, pretty => 1 });