diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-05-31 01:29:40 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-05-31 01:29:40 +0000 |
| commit | f3edf7ff7edefede242de50aca59abc4c6adc7f9 (patch) | |
| tree | 68e8260744e8ae02515c02fe71251362a031506f /nova/compute | |
| parent | 069f8f3ea4ac20271cddca0c3e209ef0af8cd0d6 (diff) | |
| parent | 26353bb372081f674cf5fd3dbbffd990918f3803 (diff) | |
Merge "Move queue_get_for() from db to rpc."
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 3 | ||||
| -rw-r--r-- | nova/compute/manager.py | 22 | ||||
| -rw-r--r-- | nova/compute/rpcapi.py | 6 |
3 files changed, 15 insertions, 16 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index 3990a9596..9f96b8e6b 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -841,7 +841,7 @@ class API(base.Base): in self.db.service_get_all_compute_sorted(context)] for host in hosts: rpc.cast(context, - self.db.queue_get_for(context, FLAGS.compute_topic, host), + rpc.queue_get_for(context, FLAGS.compute_topic, host), {'method': 'refresh_provider_fw_rules', 'args': {}}) def _is_security_group_associated_with_server(self, security_group, @@ -1814,7 +1814,6 @@ class HostAPI(base.Base): """Reboots, shuts down or powers up the host.""" # NOTE(comstud): No instance_uuid argument to this compute manager # call - topic = self.db.queue_get_for(context, FLAGS.compute_topic, host) return self.compute_rpcapi.host_power_action(context, action=action, host=host) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 856175304..7ab27f740 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -315,9 +315,9 @@ class ComputeManager(manager.SchedulerDependentManager): """ #TODO(mdragon): perhaps make this variable by console_type? - return self.db.queue_get_for(context, - FLAGS.console_topic, - FLAGS.console_host) + return rpc.queue_get_for(context, + FLAGS.console_topic, + FLAGS.console_host) def get_console_pool_info(self, context, console_type): return self.driver.get_console_pool_info(console_type) @@ -1257,7 +1257,7 @@ class ComputeManager(manager.SchedulerDependentManager): network_info = self._get_instance_nw_info(context, instance_ref) self.driver.destroy(instance_ref, self._legacy_nw_info(network_info)) - topic = self.db.queue_get_for(context, FLAGS.compute_topic, + topic = rpc.queue_get_for(context, FLAGS.compute_topic, migration_ref['source_compute']) rpc.cast(context, topic, {'method': 'finish_revert_resize', @@ -1349,7 +1349,7 @@ class ComputeManager(manager.SchedulerDependentManager): 'status': 'pre-migrating'}) LOG.audit(_('Migrating'), context=context, instance=instance_ref) - topic = self.db.queue_get_for(context, FLAGS.compute_topic, + topic = rpc.queue_get_for(context, FLAGS.compute_topic, instance_ref['host']) rpc.cast(context, topic, {'method': 'resize_instance', @@ -1412,9 +1412,9 @@ class ComputeManager(manager.SchedulerDependentManager): service = self.db.service_get_by_host_and_topic( context, migration_ref['dest_compute'], FLAGS.compute_topic) - topic = self.db.queue_get_for(context, - FLAGS.compute_topic, - migration_ref['dest_compute']) + topic = rpc.queue_get_for(context, + FLAGS.compute_topic, + migration_ref['dest_compute']) params = {'migration_id': migration_id, 'disk_info': disk_info, 'instance_uuid': instance_ref['uuid'], @@ -2040,7 +2040,7 @@ class ComputeManager(manager.SchedulerDependentManager): disk = None rpc.call(context, - self.db.queue_get_for(context, FLAGS.compute_topic, dest), + rpc.queue_get_for(context, FLAGS.compute_topic, dest), {'method': 'pre_live_migration', 'args': {'instance_id': instance_id, 'block_migration': block_migration, @@ -2122,7 +2122,7 @@ class ComputeManager(manager.SchedulerDependentManager): # Define domain at destination host, without doing it, # pause/suspend/terminate do not work. rpc.call(ctxt, - self.db.queue_get_for(ctxt, FLAGS.compute_topic, dest), + rpc.queue_get_for(ctxt, FLAGS.compute_topic, dest), {"method": "post_live_migration_at_destination", "args": {'instance_id': instance_ref['id'], 'block_migration': block_migration}}) @@ -2227,7 +2227,7 @@ class ComputeManager(manager.SchedulerDependentManager): # any empty images has to be deleted. if block_migration: rpc.cast(context, - self.db.queue_get_for(context, FLAGS.compute_topic, dest), + rpc.queue_get_for(context, FLAGS.compute_topic, dest), {"method": "rollback_live_migration_at_destination", "args": {'instance_id': instance_ref['id']}}) diff --git a/nova/compute/rpcapi.py b/nova/compute/rpcapi.py index a2a3b281c..5db0282c3 100644 --- a/nova/compute/rpcapi.py +++ b/nova/compute/rpcapi.py @@ -18,16 +18,16 @@ Client side of the compute RPC API. """ -from nova.db import base from nova import exception from nova import flags +from nova import rpc import nova.rpc.proxy FLAGS = flags.FLAGS -class ComputeAPI(nova.rpc.proxy.RpcProxy, base.Base): +class ComputeAPI(nova.rpc.proxy.RpcProxy): '''Client side of the compute rpc API. API version history: @@ -58,7 +58,7 @@ class ComputeAPI(nova.rpc.proxy.RpcProxy, base.Base): if not host: raise exception.NovaException(_('Unable to find host for ' 'Instance %s') % instance['uuid']) - return self.db.queue_get_for(ctxt, self.topic, host) + return rpc.queue_get_for(ctxt, self.topic, host) def add_aggregate_host(self, ctxt, aggregate_id, host_param, host): '''Add aggregate host. |
