Merge "Clean up object code"
This commit is contained in:
commit
1cb779eff8
@ -72,7 +72,7 @@ class Chassis(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
:returns: a :class:`Chassis` object.
|
||||
"""
|
||||
db_chassis = cls.dbapi.get_chassis_by_id(chassis_id)
|
||||
chassis = Chassis._from_db_object(cls(context), db_chassis)
|
||||
chassis = cls._from_db_object(cls(context), db_chassis)
|
||||
return chassis
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -88,7 +88,7 @@ class Chassis(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
:returns: a :class:`Chassis` object.
|
||||
"""
|
||||
db_chassis = cls.dbapi.get_chassis_by_uuid(uuid)
|
||||
chassis = Chassis._from_db_object(cls(context), db_chassis)
|
||||
chassis = cls._from_db_object(cls(context), db_chassis)
|
||||
return chassis
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -194,7 +194,7 @@ class Chassis(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
A context should be set when instantiating the
|
||||
object, e.g.: Chassis(context)
|
||||
"""
|
||||
current = self.__class__.get_by_uuid(self._context, uuid=self.uuid)
|
||||
current = self.get_by_uuid(self._context, uuid=self.uuid)
|
||||
self.obj_refresh(current)
|
||||
|
||||
|
||||
|
@ -49,7 +49,7 @@ class Conductor(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
:returns: a :class:`Conductor` object.
|
||||
"""
|
||||
db_obj = cls.dbapi.get_conductor(hostname)
|
||||
conductor = Conductor._from_db_object(cls(context), db_obj)
|
||||
conductor = cls._from_db_object(cls(context), db_obj)
|
||||
return conductor
|
||||
|
||||
def save(self, context):
|
||||
@ -75,8 +75,7 @@ class Conductor(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
A context should be set when instantiating the
|
||||
object, e.g.: Conductor(context)
|
||||
"""
|
||||
current = self.__class__.get_by_hostname(self._context,
|
||||
hostname=self.hostname)
|
||||
current = self.get_by_hostname(self._context, hostname=self.hostname)
|
||||
self.obj_refresh(current)
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -108,7 +107,7 @@ class Conductor(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
db_cond = cls.dbapi.register_conductor({'hostname': hostname,
|
||||
'drivers': drivers},
|
||||
update_existing=update_existing)
|
||||
return Conductor._from_db_object(cls(context), db_cond)
|
||||
return cls._from_db_object(cls(context), db_cond)
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
# methods can be used in the future to replace current explicit RPC calls.
|
||||
|
@ -184,7 +184,7 @@ class Node(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
:returns: a :class:`Node` object.
|
||||
"""
|
||||
db_node = cls.dbapi.get_node_by_id(node_id)
|
||||
node = Node._from_db_object(cls(context), db_node)
|
||||
node = cls._from_db_object(cls(context), db_node)
|
||||
return node
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -199,7 +199,7 @@ class Node(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
:returns: a :class:`Node` object.
|
||||
"""
|
||||
db_node = cls.dbapi.get_node_by_uuid(uuid)
|
||||
node = Node._from_db_object(cls(context), db_node)
|
||||
node = cls._from_db_object(cls(context), db_node)
|
||||
return node
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -214,7 +214,7 @@ class Node(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
:returns: a :class:`Node` object.
|
||||
"""
|
||||
db_node = cls.dbapi.get_node_by_name(name)
|
||||
node = Node._from_db_object(cls(context), db_node)
|
||||
node = cls._from_db_object(cls(context), db_node)
|
||||
return node
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -229,7 +229,7 @@ class Node(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
:returns: a :class:`Node` object.
|
||||
"""
|
||||
db_node = cls.dbapi.get_node_by_instance(instance_uuid)
|
||||
node = Node._from_db_object(cls(context), db_node)
|
||||
node = cls._from_db_object(cls(context), db_node)
|
||||
return node
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -274,7 +274,7 @@ class Node(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
|
||||
"""
|
||||
db_node = cls.dbapi.reserve_node(tag, node_id)
|
||||
node = Node._from_db_object(cls(context), db_node)
|
||||
node = cls._from_db_object(cls(context), db_node)
|
||||
return node
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -384,7 +384,7 @@ class Node(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
A context should be set when instantiating the
|
||||
object, e.g.: Node(context)
|
||||
"""
|
||||
current = self.__class__.get_by_uuid(self._context, self.uuid)
|
||||
current = self.get_by_uuid(self._context, self.uuid)
|
||||
self.obj_refresh(current)
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -405,7 +405,7 @@ class Node(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
:returns: a :class:`Node` object.
|
||||
"""
|
||||
db_node = cls.dbapi.get_node_by_port_addresses(addresses)
|
||||
node = Node._from_db_object(cls(context), db_node)
|
||||
node = cls._from_db_object(cls(context), db_node)
|
||||
return node
|
||||
|
||||
|
||||
|
@ -92,7 +92,7 @@ class Port(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
|
||||
"""
|
||||
db_port = cls.dbapi.get_port_by_id(port_id)
|
||||
port = Port._from_db_object(cls(context), db_port)
|
||||
port = cls._from_db_object(cls(context), db_port)
|
||||
return port
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -110,7 +110,7 @@ class Port(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
|
||||
"""
|
||||
db_port = cls.dbapi.get_port_by_uuid(uuid)
|
||||
port = Port._from_db_object(cls(context), db_port)
|
||||
port = cls._from_db_object(cls(context), db_port)
|
||||
return port
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -128,7 +128,7 @@ class Port(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
|
||||
"""
|
||||
db_port = cls.dbapi.get_port_by_address(address)
|
||||
port = Port._from_db_object(cls(context), db_port)
|
||||
port = cls._from_db_object(cls(context), db_port)
|
||||
return port
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -288,7 +288,7 @@ class Port(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
:raises: PortNotFound
|
||||
|
||||
"""
|
||||
current = self.__class__.get_by_uuid(self._context, uuid=self.uuid)
|
||||
current = self.get_by_uuid(self._context, uuid=self.uuid)
|
||||
self.obj_refresh(current)
|
||||
|
||||
|
||||
|
@ -88,7 +88,7 @@ class Portgroup(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
|
||||
"""
|
||||
db_portgroup = cls.dbapi.get_portgroup_by_id(portgroup_id)
|
||||
portgroup = Portgroup._from_db_object(cls(context), db_portgroup)
|
||||
portgroup = cls._from_db_object(cls(context), db_portgroup)
|
||||
return portgroup
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -106,7 +106,7 @@ class Portgroup(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
|
||||
"""
|
||||
db_portgroup = cls.dbapi.get_portgroup_by_uuid(uuid)
|
||||
portgroup = Portgroup._from_db_object(cls(context), db_portgroup)
|
||||
portgroup = cls._from_db_object(cls(context), db_portgroup)
|
||||
return portgroup
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -124,7 +124,7 @@ class Portgroup(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
|
||||
"""
|
||||
db_portgroup = cls.dbapi.get_portgroup_by_address(address)
|
||||
portgroup = Portgroup._from_db_object(cls(context), db_portgroup)
|
||||
portgroup = cls._from_db_object(cls(context), db_portgroup)
|
||||
return portgroup
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -142,7 +142,7 @@ class Portgroup(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
|
||||
"""
|
||||
db_portgroup = cls.dbapi.get_portgroup_by_name(name)
|
||||
portgroup = Portgroup._from_db_object(cls(context), db_portgroup)
|
||||
portgroup = cls._from_db_object(cls(context), db_portgroup)
|
||||
return portgroup
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -277,5 +277,5 @@ class Portgroup(base.IronicObject, object_base.VersionedObjectDictCompat):
|
||||
:raises: PortgroupNotFound
|
||||
|
||||
"""
|
||||
current = self.__class__.get_by_uuid(self._context, uuid=self.uuid)
|
||||
current = self.get_by_uuid(self._context, uuid=self.uuid)
|
||||
self.obj_refresh(current)
|
||||
|
@ -78,7 +78,7 @@ class VolumeConnector(base.IronicObject,
|
||||
the specified ID.
|
||||
"""
|
||||
db_connector = cls.dbapi.get_volume_connector_by_id(db_id)
|
||||
connector = VolumeConnector._from_db_object(cls(context), db_connector)
|
||||
connector = cls._from_db_object(cls(context), db_connector)
|
||||
return connector
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -96,7 +96,7 @@ class VolumeConnector(base.IronicObject,
|
||||
the specified UUID
|
||||
"""
|
||||
db_connector = cls.dbapi.get_volume_connector_by_uuid(uuid)
|
||||
connector = VolumeConnector._from_db_object(cls(context), db_connector)
|
||||
connector = cls._from_db_object(cls(context), db_connector)
|
||||
return connector
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -235,5 +235,5 @@ class VolumeConnector(base.IronicObject,
|
||||
A context should be set when instantiating the
|
||||
object, e.g.: VolumeConnector(context).
|
||||
"""
|
||||
current = self.__class__.get_by_uuid(self._context, uuid=self.uuid)
|
||||
current = self.get_by_uuid(self._context, uuid=self.uuid)
|
||||
self.obj_refresh(current)
|
||||
|
@ -78,7 +78,7 @@ class VolumeTarget(base.IronicObject,
|
||||
:raises: VolumeTargetNotFound if no volume target with this ID exists
|
||||
"""
|
||||
db_target = cls.dbapi.get_volume_target_by_id(db_id)
|
||||
target = VolumeTarget._from_db_object(cls(context), db_target)
|
||||
target = cls._from_db_object(cls(context), db_target)
|
||||
return target
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -95,7 +95,7 @@ class VolumeTarget(base.IronicObject,
|
||||
:raises: VolumeTargetNotFound if no volume target with this UUID exists
|
||||
"""
|
||||
db_target = cls.dbapi.get_volume_target_by_uuid(uuid)
|
||||
target = VolumeTarget._from_db_object(cls(context), db_target)
|
||||
target = cls._from_db_object(cls(context), db_target)
|
||||
return target
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
@ -119,7 +119,7 @@ class VolumeTarget(base.IronicObject,
|
||||
marker=marker,
|
||||
sort_key=sort_key,
|
||||
sort_dir=sort_dir)
|
||||
return VolumeTarget._from_db_object_list(context, db_targets)
|
||||
return cls._from_db_object_list(context, db_targets)
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
# methods can be used in the future to replace current explicit RPC calls.
|
||||
@ -145,7 +145,7 @@ class VolumeTarget(base.IronicObject,
|
||||
marker=marker,
|
||||
sort_key=sort_key,
|
||||
sort_dir=sort_dir)
|
||||
return VolumeTarget._from_db_object_list(context, db_targets)
|
||||
return cls._from_db_object_list(context, db_targets)
|
||||
|
||||
# NOTE(xek): We don't want to enable RPC on this call just yet. Remotable
|
||||
# methods can be used in the future to replace current explicit RPC calls.
|
||||
@ -231,5 +231,5 @@ class VolumeTarget(base.IronicObject,
|
||||
object, e.g.: VolumeTarget(context).
|
||||
:raises: VolumeTargetNotFound if the volume target cannot be found
|
||||
"""
|
||||
current = self.__class__.get_by_uuid(self._context, uuid=self.uuid)
|
||||
current = self.get_by_uuid(self._context, uuid=self.uuid)
|
||||
self.obj_refresh(current)
|
||||
|
Loading…
x
Reference in New Issue
Block a user