diff options
author | Ben Pfaff <blp@nicira.com> | 2011-05-02 16:17:11 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-05-23 13:41:18 -0700 |
commit | 6aaf8f1367209fdc994b6482999ae212a7993cb0 (patch) | |
tree | ef4ad541cc3c50b4239d604b071ab92efa47889b /ovsdb/ovsdbmonitor/OVEFetch.py | |
parent | 58f870d005d48f299785e7dbd0f153dd544f2a5a (diff) |
ovsdbmonitor: Use ovs.json module instead of JsonReader and JsonWriter.
I can't figure out where JsonReader and JsonWriter come from. I know that
they must exist, because I (and others) have used ovsdbmonitor before, but
I can't find them now.
Switch to using ovs.json, which is part of Open vSwitch so we know that
it exists. At the same time, we have to start translating the Unicode
strings that ovs.json outputs into standard Python strings; otherwise
the "twisted conch" ssh implementation craps out because it tries to
concatenate this Unicode string with a standard string that contains
non-ASCII characters.
Diffstat (limited to 'ovsdb/ovsdbmonitor/OVEFetch.py')
-rw-r--r-- | ovsdb/ovsdbmonitor/OVEFetch.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ovsdb/ovsdbmonitor/OVEFetch.py b/ovsdb/ovsdbmonitor/OVEFetch.py index 9dd1118b..8bc5757c 100644 --- a/ovsdb/ovsdbmonitor/OVEFetch.py +++ b/ovsdb/ovsdbmonitor/OVEFetch.py @@ -1,3 +1,4 @@ +# Copyright (c) 2011 Nicira Networks. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,6 +16,7 @@ from OVEStandard import * from OVEConfig import * from OVELogger import * +import ovs.json # This sequence installs the qt4reactor before twisted gets a chance to install its reactor import qt4reactor @@ -166,7 +168,7 @@ class OVECommandChannel(channel.SSHChannel, QtCore.QObject): if self.commandType == 'JSON': try: # Decode the JSON data, to confirm that we have all of the data - self._jsonValues = json.read(str(self._data)) # FIXME: Should handle unicode + self._jsonValues = ovs.json.from_string(str(self._data)) # FIXME: Should handle unicode self.sendResult() except: pass # Wait for more data |