Skip to content

Commit 461b040

Browse files
committed
Merge pull request voxpupuli#281 from epleterte/json_remove_jsobjects
General gsub to catch all instances of JS objects
2 parents d149aca + 1ffb514 commit 461b040

File tree

1 file changed

+1
-2
lines changed
  • lib/puppet/provider/mongodb_replset

1 file changed

+1
-2
lines changed

lib/puppet/provider/mongodb_replset/mongo.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ def self.mongo_command(command, host=nil, retries=4)
266266
end
267267

268268
# Dirty hack to remove JavaScript objects
269-
output.gsub!(/ISODate\((.+?)\)/, '\1 ')
270-
output.gsub!(/Timestamp\((.+?)\)/, '[\1]')
269+
output.gsub!(/\w+\((.+?)\)/, '\1')
271270

272271
#Hack to avoid non-json empty sets
273272
output = "{}" if output == "null\n"

0 commit comments

Comments
 (0)