cinder.objects.cleanable module¶
- class CinderCleanableObject¶
Bases:
CinderPersistentObject
Base class for cleanable OVO resources.
All cleanable objects must have a host property/attribute.
- classmethod cinder_ovo_cls_init()¶
Called on OVO registration, sets set of cleanable resources.
- cleanable_resource_types = {'Snapshot', 'Volume'}¶
- create_worker(pinned=True)¶
Create a worker entry at the API.
- static decorate(func, caller, extras=(), kwsyntax=False)¶
Decorates a function/generator/coroutine using a caller. If kwsyntax is True calling the decorated functions with keyword syntax will pass the named arguments inside the
kw
dictionary, even if such argument are positional, similarly to what functools.wraps does. By default kwsyntax is False and the the arguments are untouched.
- classmethod get_pinned_version()¶
- classmethod get_rpc_api()¶
- is_cleanable(pinned=False)¶
Check if cleanable VO status is cleanable.
- Parameters:
pinned (bool) – If we should check against pinned version or current version.
- Returns:
Whether this needs a workers DB entry or not
- refresh()¶
- set_worker()¶
- static set_workers(*decorator_args)¶
Decorator that adds worker DB rows for cleanable versioned objects.
By default will take care of all cleanable objects, but we can limit which objects we want by passing the name of the arguments we want to be added.
- unset_worker()¶
- worker = None¶