Skip to content

Commit afb9ea3

Browse files
committed
Merge pull request voxpupuli#274 from parship/master
parse NumberLong data type from mongodb outputs to generate valid json
2 parents b43c19c + ce85922 commit afb9ea3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/puppet/provider/mongodb.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ def self.mongo_eval(cmd, db = 'admin', retries = 10, host = nil)
181181
raise Puppet::ExecutionFailure, "Could not evalute MongoDB shell command: #{cmd}"
182182
end
183183

184-
out.gsub!(/ObjectId\(([^)]*)\)/, '\1')
184+
['ObjectId','NumberLong'].each do |data_type|
185+
out.gsub!(/#{data_type}\(([^)]*)\)/, '\1')
186+
end
185187
out.gsub!(/^Error\:.+/, '')
186188
out
187189
end

0 commit comments

Comments
 (0)