notification.info_from_instance should use get()
Bug #1224921 reported by
Phil Day
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Opinion
|
Wishlist
|
Unassigned |
Bug Description
notification.
Whilst such cases are triggered by bugs the notification code should be more robust and use .get() methods instead.
tags: | added: compute |
To post a comment you must log in.
Hi Phil, can you please give more detail on the problem.
Do you mean that we need change the following to instance_ref.get()?
instance_info = dict(
tenant_ id=instance_ ref['project_ id'],
user_id= instance_ ref['user_ id'],
# Owner properties
# Identity properties
instance_ id=instance_ ref['uuid' ],
display_ name=instance_ ref['display_ name'],
reservation_ id=instance_ ref['reservatio n_id'],
hostname= instance_ ref['hostname' ],
# Type properties
instance_ type=instance_ type_name,
instance_ type_id= instance_ ref['instance_ type_id' ],
architecture= instance_ ref['architectu re'],
# Capacity properties
memory_ mb=instance_ ref['memory_ mb'],
disk_gb= instance_ ref['root_ gb'] + instance_ ref['ephemeral_ gb'],
vcpus= instance_ ref['vcpus' ],
...... ....... ..
# Note(dhellmann): This makes th
I'm not clear about the following: info_from_ instance( ) reads many values from the instance structure, including capacity vales that are populated from the instance_ system_ metadata table.
notification.
>>>>>>>>> How does capacity vales get from system metadata in this function?
Thanks.