The cinder.objects.base Module

Cinder common internal object model

class CinderComparableObject

Bases: oslo_versionedobjects.base.ComparableVersionedObject

class CinderObject(context=None, **kwargs)

Bases: oslo_versionedobjects.base.VersionedObject

OBJ_PROJECT_NAMESPACE = 'cinder'
VERSION_COMPATIBILITY = {'7.0.0': '1.0'}
cinder_obj_get_changes()

Returns a dict of changed fields with tz unaware datetimes.

Any timezone aware datetime field will be converted to UTC timezone and returned as timezone unaware datetime.

This will allow us to pass these fields directly to a db update method as they can’t have timezone information.

fields = {}
class CinderObjectDictCompat

Bases: oslo_versionedobjects.base.VersionedObjectDictCompat

Mix-in to provide dictionary key access compat.

If an object needs to support attribute access using dictionary items instead of object attributes, inherit from this class. This should only be used as a temporary measure until all callers are converted to use modern attribute access.

NOTE(berrange) This class will eventually be deleted.

get(key, value=<class 'oslo_versionedobjects.base._NotSpecifiedSentinel'>)

For backwards-compatibility with dict-based objects.

NOTE(danms): May be removed in the future.

class CinderObjectRegistry

Bases: oslo_versionedobjects.base.VersionedObjectRegistry

registration_hook(cls, index)
class CinderObjectSerializer

Bases: oslo_versionedobjects.base.VersionedObjectSerializer

OBJ_BASE_CLASS

alias of CinderObject

class CinderPersistentObject

Bases: object

Mixin class for Persistent objects.

This adds the fields that we use in common for all persistent objects.

fields = {'deleted': Boolean(default=False,nullable=False), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'deleted_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True)}
obj_as_admin(*args, **kwds)

Context manager to make an object call as an admin.

This temporarily modifies the context embedded in an object to be elevated() and restores it after the call completes. Example usage:

with obj.obj_as_admin():
obj.save()
class ObjectListBase(*args, **kwargs)

Bases: oslo_versionedobjects.base.ObjectListBase

Previous topic

The cinder.objects.backup Module

Next topic

The cinder.objects.consistencygroup Module

Project Source

This Page