summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrumale <rumale@ebaysf.com>2014-09-11 11:23:54 -0700
committerrumale <rumale@ebaysf.com>2014-09-11 11:23:54 -0700
commitf193a9da0532bcc900b67f0700a5efa467822651 (patch)
treeea7ce4b4d758065f2ef107d371a64249245a24b3
parent70417f0b1d411343ab552f32bc4b12ad9724e9d3 (diff)
downloadtrove-f193a9da0532bcc900b67f0700a5efa467822651.tar.gz
Strengthens the regex for mongodb json functions
Encloses function args in quotes. abc: Foo(foo, bar) changes to abc : "foo, bar". Intent is to prevent mongodb json peculiarities from preventing parsing of the json Change-Id: Iafd81cf74908078155344ef4746632d48c460f6a Closes-Bug: #1368373
-rw-r--r--trove/guestagent/datastore/mongodb/service.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/trove/guestagent/datastore/mongodb/service.py b/trove/guestagent/datastore/mongodb/service.py
index 67536e18..a1b58685 100644
--- a/trove/guestagent/datastore/mongodb/service.py
+++ b/trove/guestagent/datastore/mongodb/service.py
@@ -265,7 +265,7 @@ class MongoDBApp(object):
This method removes from json, values that are functions like
ISODate(), TimeStamp().
"""
- return re.sub(':\s*\w+\((.*)\)', r": \1", (val))
+ return re.sub(':\s*\w+\(\"?(.*?)\"?\)', r': "\1"', val)
def check_initiate_status():
"""