From 8fe32f01f305820a581af14349e3b42c9760bc8a Mon Sep 17 00:00:00 2001 From: Sudipta Biswas Date: Mon, 12 Dec 2016 11:20:11 +0530 Subject: [PATCH] Remove dict-compat from the zun_service obj This patch removes the need of having dict-compat for the zun service object. Change-Id: I8ef3edb1833352f2543a1bd138ca5fcf4e26ebd4 Partially-Implements: blueprint rm-object-dict-compat --- zun/objects/zun_service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zun/objects/zun_service.py b/zun/objects/zun_service.py index c1235172a..7f24324bf 100644 --- a/zun/objects/zun_service.py +++ b/zun/objects/zun_service.py @@ -17,8 +17,8 @@ from zun.objects import base @base.ZunObjectRegistry.register -class ZunService(base.ZunPersistentObject, base.ZunObject, - base.ZunObjectDictCompat): +class ZunService(base.ZunPersistentObject, base.ZunObject): + # Version 1.0: Initial version VERSION = '1.0' @@ -37,7 +37,7 @@ class ZunService(base.ZunPersistentObject, base.ZunObject, def _from_db_object(zun_service, db_zun_service): """Converts a database entity to a formal object.""" for field in zun_service.fields: - zun_service[field] = db_zun_service[field] + setattr(zun_service, field, db_zun_service[field]) zun_service.obj_reset_changes() return zun_service