Merge "Optimize deployble object module"
This commit is contained in:
commit
839e14da23
@ -65,7 +65,6 @@ class Deployable(base.CyborgObject, object_base.VersionedObjectDictCompat):
|
|||||||
db_dep = self.dbapi.deployable_create(context, values)
|
db_dep = self.dbapi.deployable_create(context, values)
|
||||||
self._from_db_object(self, db_dep)
|
self._from_db_object(self, db_dep)
|
||||||
self.obj_reset_changes()
|
self.obj_reset_changes()
|
||||||
del self.attributes_list[:]
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get(cls, context, uuid):
|
def get(cls, context, uuid):
|
||||||
@ -145,20 +144,6 @@ class Deployable(base.CyborgObject, object_base.VersionedObjectDictCompat):
|
|||||||
|
|
||||||
return obj_dpl_list
|
return obj_dpl_list
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def _from_db_object(obj, db_obj):
|
|
||||||
"""Converts a deployable to a formal object.
|
|
||||||
|
|
||||||
:param obj: An object of the class.
|
|
||||||
:param db_obj: A DB model of the object
|
|
||||||
:return: The object of the class with the database entity added
|
|
||||||
"""
|
|
||||||
for field in obj.fields:
|
|
||||||
obj[field] = db_obj[field]
|
|
||||||
obj.attributes_list = []
|
|
||||||
|
|
||||||
return obj
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_list_by_device_id(cls, context, device_id):
|
def get_list_by_device_id(cls, context, device_id):
|
||||||
dep_filter = {'device_id': device_id}
|
dep_filter = {'device_id': device_id}
|
||||||
|
Loading…
Reference in New Issue
Block a user