diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-06-07 18:45:46 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-06-07 18:45:46 +0000 |
| commit | f088bdfd1cabcb5d03f473d20d7e76e3287acd9c (patch) | |
| tree | a0f414fa677913bdb77738ee22ff219c645b400e /nova/compute | |
| parent | cf34a6015762a82780f86004a76439e1e21340f8 (diff) | |
| parent | 8db54f3bd590e71c6c6e383c928aa82fc28b3379 (diff) | |
Merge "Don't query nova-network on startup."
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/manager.py | 2 | ||||
| -rw-r--r-- | nova/compute/utils.py | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 4735f4a76..522cb77cc 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -287,7 +287,7 @@ class ComputeManager(manager.SchedulerDependentManager): LOG.debug(_('Current state is %(drv_state)s, state in DB is ' '%(db_state)s.'), locals(), instance=instance) - net_info = self._get_instance_nw_info(context, instance) + net_info = compute_utils.get_nw_info_for_instance(instance) if ((expect_running and FLAGS.resume_guests_state_on_host_boot) or FLAGS.start_guests_on_host_boot): LOG.info(_('Rebooting instance after nova-compute restart.'), diff --git a/nova/compute/utils.py b/nova/compute/utils.py index f63203a1a..67a174f51 100644 --- a/nova/compute/utils.py +++ b/nova/compute/utils.py @@ -19,6 +19,7 @@ from nova import db from nova import flags from nova import log +from nova.network import model as network_model from nova import notifications from nova.notifier import api as notifier_api @@ -100,3 +101,9 @@ def notify_about_instance_usage(context, instance, event_suffix, notifier_api.notify(context, 'compute.%s' % host, 'compute.instance.%s' % event_suffix, notifier_api.INFO, usage_info) + + +def get_nw_info_for_instance(instance): + info_cache = instance['info_cache'] or {} + cached_nwinfo = info_cache.get('network_info') or [] + return network_model.NetworkInfo.hydrate(cached_nwinfo) |
