diff options
author | rumale <rumale@ebaysf.com> | 2014-09-11 11:23:54 -0700 |
---|---|---|
committer | rumale <rumale@ebaysf.com> | 2014-09-11 11:23:54 -0700 |
commit | f193a9da0532bcc900b67f0700a5efa467822651 (patch) | |
tree | ea7ce4b4d758065f2ef107d371a64249245a24b3 | |
parent | 70417f0b1d411343ab552f32bc4b12ad9724e9d3 (diff) | |
download | trove-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.py | 2 |
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(): """ |