diff options
-rw-r--r-- | nova/compute/api.py | 4 | ||||
-rw-r--r-- | nova/compute/rpcapi.py | 4 | ||||
-rw-r--r-- | nova/tests/compute/test_rpcapi.py | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index d2d99d430..6e9a91a38 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -840,9 +840,7 @@ class API(base.Base): hosts = [x['host'] for (x, idx) in self.db.service_get_all_compute_sorted(context)] for host in hosts: - rpc.cast(context, - rpc.queue_get_for(context, FLAGS.compute_topic, host), - {'method': 'refresh_provider_fw_rules', 'args': {}}) + self.compute_rpcapi.refresh_provider_fw_rules(context, host) def _is_security_group_associated_with_server(self, security_group, instance_uuid): diff --git a/nova/compute/rpcapi.py b/nova/compute/rpcapi.py index 005b5a8a5..d65715b72 100644 --- a/nova/compute/rpcapi.py +++ b/nova/compute/rpcapi.py @@ -202,6 +202,10 @@ class ComputeAPI(nova.rpc.proxy.RpcProxy): orig_image_ref=orig_image_ref), topic=self._compute_topic(ctxt, None, instance)) + def refresh_provider_fw_rules(self, ctxt, host): + self.cast(ctxt, self.make_msg('refresh_provider_fw_rules'), + self._compute_topic(ctxt, host, None)) + def refresh_security_group_rules(self, ctxt, security_group_id, host): self.cast(ctxt, self.make_msg('refresh_security_group_rules', security_group_id=security_group_id), diff --git a/nova/tests/compute/test_rpcapi.py b/nova/tests/compute/test_rpcapi.py index 3f5e63d35..02ac53102 100644 --- a/nova/tests/compute/test_rpcapi.py +++ b/nova/tests/compute/test_rpcapi.py @@ -194,6 +194,10 @@ class ComputeRpcAPITestCase(test.TestCase): injected_files='files', image_ref='ref', orig_image_ref='orig_ref') + def refresh_provider_fw_rules(self): + self._test_compute_api('refresh_provider_fw_rules', 'cast', + host='host') + def test_refresh_security_group_rules(self): self._test_compute_api('refresh_security_group_rules', 'cast', security_group_id='id', host='host') |