python3 compatibility fix

Change-Id: Ia3aac16a4c73440fe08632033c968ff0261f5c3f
This commit is contained in:
Jake Yip 2018-08-27 11:11:13 +10:00
parent 8e254267bf
commit 72a29d8e43
1 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import json
from oslo_serialization import jsonutils
class BaseModel(object):
@ -18,10 +18,10 @@ class BaseModel(object):
@classmethod
def from_json(cls, json_str):
return cls.from_dict(json.loads(json_str))
return cls.from_dict(jsonutils.loads(json_str))
def to_json(self):
return json.dumps(self.to_dict())
return jsonutils.dumps(self.to_dict())
@classmethod
def from_dict(cls, data):