Skip to content

Commit

Permalink
Merge pull request #103 from deepfry0/master
Browse files Browse the repository at this point in the history
Update cli_execution.rb to convert "big decimal" strings to valid json.
  • Loading branch information
itewk committed Mar 2, 2016
2 parents 3ce540a + b8fb8e8 commit 2e2ad22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet/util/cli_execution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def execute_cli(server, command, failonfail = true, batch = false, tries = 3 , t
end
#else, retry
else
json_string = '[' + output.gsub(/ => undefined/, ': null').gsub(/=>/, ':').gsub(/: expression/, ': ').gsub(/\}\n\{/m, "},{").gsub(/\n/, '').gsub(/ (-?\d+)L/, ' \1').gsub(/bytes\s*\{([^\}]*)\}/,'"bytes {\1}"') + ']'
json_string = '[' + output.gsub(/ => undefined/, ': null').gsub(/ => big decimal/, ': ').gsub(/=>/, ':').gsub(/: expression/, ': ').gsub(/\}\n\{/m, "},{").gsub(/\n/, '').gsub(/ (-?\d+)L/, ' \1').gsub(/bytes\s*\{([^\}]*)\}/,'"bytes {\1}"') + ']'

begin
parsed_output = JSON.parse(json_string)
Expand Down

0 comments on commit 2e2ad22

Please sign in to comment.