Remove the usage of MagnumObjectDictCompat from x509keypair
Nova has removed the usage of NovaObjectDictCompat: https://blueprints.launchpad.net/nova/+spec/rm-object-dict-compat. magnum needs a similar cleanup. Change-Id: I69dc2d5bec54b6d3228dcb6ba834e5cc515c6a3f Partially-Implements: blueprint rm-object-dict-compat
This commit is contained in:
parent
8ddef55e13
commit
3dc50e2ad1
@ -20,8 +20,7 @@ from magnum.objects import base
|
|||||||
|
|
||||||
|
|
||||||
@base.MagnumObjectRegistry.register
|
@base.MagnumObjectRegistry.register
|
||||||
class X509KeyPair(base.MagnumPersistentObject, base.MagnumObject,
|
class X509KeyPair(base.MagnumPersistentObject, base.MagnumObject):
|
||||||
base.MagnumObjectDictCompat):
|
|
||||||
# Version 1.0: Initial version
|
# Version 1.0: Initial version
|
||||||
# Version 1.1: Added new method get_x509keypair_by_bay_uuid
|
# Version 1.1: Added new method get_x509keypair_by_bay_uuid
|
||||||
# Version 1.2: Remove bay_uuid, name, ca_cert and add intermediates
|
# Version 1.2: Remove bay_uuid, name, ca_cert and add intermediates
|
||||||
@ -45,7 +44,7 @@ class X509KeyPair(base.MagnumPersistentObject, base.MagnumObject,
|
|||||||
def _from_db_object(x509keypair, db_x509keypair):
|
def _from_db_object(x509keypair, db_x509keypair):
|
||||||
"""Converts a database entity to a formal object."""
|
"""Converts a database entity to a formal object."""
|
||||||
for field in x509keypair.fields:
|
for field in x509keypair.fields:
|
||||||
x509keypair[field] = db_x509keypair[field]
|
setattr(x509keypair, field, db_x509keypair[field])
|
||||||
|
|
||||||
x509keypair.obj_reset_changes()
|
x509keypair.obj_reset_changes()
|
||||||
return x509keypair
|
return x509keypair
|
||||||
@ -188,5 +187,6 @@ class X509KeyPair(base.MagnumPersistentObject, base.MagnumObject,
|
|||||||
"""
|
"""
|
||||||
current = self.__class__.get_by_uuid(self._context, uuid=self.uuid)
|
current = self.__class__.get_by_uuid(self._context, uuid=self.uuid)
|
||||||
for field in self.fields:
|
for field in self.fields:
|
||||||
if self.obj_attr_is_set(field) and self[field] != current[field]:
|
if self.obj_attr_is_set(field) and \
|
||||||
self[field] = current[field]
|
getattr(self, field) != getattr(current, field):
|
||||||
|
setattr(self, field, getattr(current, field))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user