Bases: nova.objects.base.NovaObject
Create instance from image metadata dict
Parameters: | image_meta – image metadata dictionary |
---|
Creates a new object instance, initializing from the properties associated with the image metadata instance
Returns: | an ImageMeta instance |
---|
Create instance from instance system metadata
Parameters: | instance – Instance object |
---|
Creates a new object instance, initializing from the system metadata “image_*” properties associated with instance
Returns: | an ImageMeta instance |
---|
Bases: nova.objects.base.NovaObject
Create instance from image properties dict
Parameters: | image_props – dictionary of image metdata properties |
---|
Creates a new object instance, initializing from a dictionary of image metadata properties
Returns: | an ImageMetaProps instance |
---|
Get the value of an attribute :param name: the attribute to request :param defvalue: the default value if not set
This returns the value of an attribute if it is currently set, otherwise it will return None.
This differs from accessing props.attrname, because that will raise an exception if the attribute has no value set.
So instead of
- if image_meta.properties.obj_attr_is_set(“some_attr”):
- val = image_meta.properties.some_attr
- else
- val = None
Callers can rely on unconditional access
val = image_meta.properties.get(“some_attr”)
Returns: | the attribute value or None |
---|