From 16599c060f2fcc5f43cb8cc831a57afaeca2ad4f Mon Sep 17 00:00:00 2001 From: Hans Lindgren Date: Sat, 26 Jan 2013 15:50:31 +0100 Subject: Refactoring/cleanup of compute and db apis Refactor db call usage and remove some unused code. Change-Id: I49466f7ab54dd6dbf0fc78bab3d2df44392ba3ee --- nova/compute/api.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index 06ce2e07e..6022e2730 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -91,7 +91,6 @@ compute_opts = [ CONF = cfg.CONF CONF.register_opts(compute_opts) CONF.import_opt('compute_topic', 'nova.compute.rpcapi') -CONF.import_opt('consoleauth_topic', 'nova.consoleauth') CONF.import_opt('enable', 'nova.cells.opts', group='cells') MAX_USERDATA_SIZE = 65535 @@ -877,9 +876,9 @@ class API(base.Base): def trigger_provider_fw_rules_refresh(self, context): """Called when a rule is added/removed from a provider firewall.""" - host_names = [x['host'] for (x, idx) - in self.db.service_get_all_compute_sorted(context)] - for host_name in host_names: + for service in self.db.service_get_all_by_topic(context, + CONF.compute_topic): + host_name = service['host'] self.compute_rpcapi.refresh_provider_fw_rules(context, host_name) def update_state(self, context, instance, new_state): -- cgit