diff options
| author | Chris Behrens <cbehrens@codestud.com> | 2012-06-26 02:06:35 +0000 |
|---|---|---|
| committer | Chris Behrens <cbehrens@codestud.com> | 2012-06-26 02:06:35 +0000 |
| commit | b8eed845d72f266a929f773ff08b1c8c641e913f (patch) | |
| tree | 2db8e724daa734e0bd219a5f56a518b398a0ff8c | |
| parent | 936140de2c42b8e1b4cf1edde1e6fb25bcd75c59 (diff) | |
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
| -rw-r--r-- | nova/notifications.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/notifications.py b/nova/notifications.py index 654ba5d25..29bca2c2f 100644 --- a/nova/notifications.py +++ b/nova/notifications.py @@ -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) |
