Remove unnecessary queries for network info in notifications
bandwidth_usage() tries to query network info if "not network_info" when looking at instance['info_cache']. [] is a valid entry for network_info (on build)... so don't query network when we see it. Fixes bug 1017770 Change-Id: Ia7291dbbcc25c04eff16eb048068f879e18f53a4
This commit is contained in:
@@ -158,7 +158,7 @@ def bandwidth_usage(instance_ref, audit_start,
|
||||
admin_context = nova.context.get_admin_context(read_deleted='yes')
|
||||
|
||||
if (instance_ref.get('info_cache') and
|
||||
instance_ref['info_cache'].get('network_info')):
|
||||
instance_ref['info_cache'].get('network_info') is not None):
|
||||
|
||||
cached_info = instance_ref['info_cache']['network_info']
|
||||
nw_info = network_model.NetworkInfo.hydrate(cached_info)
|
||||
|
||||
Reference in New Issue
Block a user