From 72f88dcab096a10a7337f375f81f78a18ac677f4 Mon Sep 17 00:00:00 2001 From: James Page Date: Fri, 15 Dec 2017 16:50:39 +0000 Subject: [PATCH] Drop zeromq support Support for the ZeroMQ messaging driver has bit-rotted over the last few years across the OpenStack charms; drop support for ZMQ inline with deprecation notices issued in 17.02 charm release. Change-Id: I9ebd2fcbbe8514943e7aba0f9ea2a492b61b1dbd --- hooks/neutron_hooks.py | 18 ---------------- hooks/neutron_utils.py | 23 +-------------------- hooks/zeromq-configuration-relation-changed | 1 - hooks/zeromq-configuration-relation-joined | 1 - metadata.yaml | 3 --- unit_tests/test_neutron_hooks.py | 4 ---- 6 files changed, 1 insertion(+), 49 deletions(-) delete mode 120000 hooks/zeromq-configuration-relation-changed delete mode 120000 hooks/zeromq-configuration-relation-joined diff --git a/hooks/neutron_hooks.py b/hooks/neutron_hooks.py index 8e6ae316..8d744f74 100755 --- a/hooks/neutron_hooks.py +++ b/hooks/neutron_hooks.py @@ -33,7 +33,6 @@ from charmhelpers.contrib.openstack.utils import ( config_value_changed, configure_installation_source, openstack_upgrade_available, - os_requires_version, pausable_restart_on_change as restart_on_change, is_unit_paused_set, ) @@ -52,7 +51,6 @@ from neutron_utils import ( do_openstack_upgrade, get_packages, get_early_packages, - get_topics, git_install, git_install_requested, valid_plugin, @@ -136,8 +134,6 @@ def config_changed(): amqp_joined(relation_id=r_id) for r_id in relation_ids('amqp-nova'): amqp_nova_joined(relation_id=r_id) - for rid in relation_ids('zeromq-configuration'): - zeromq_configuration_relation_joined(rid) if valid_plugin(): CONFIGS.write_all() configure_ovs() @@ -269,20 +265,6 @@ def stop(): cleanup_ovs_netns() -@hooks.hook('zeromq-configuration-relation-joined') -@os_requires_version('kilo', NEUTRON_COMMON) -def zeromq_configuration_relation_joined(relid=None): - relation_set(relation_id=relid, - topics=" ".join(get_topics()), - users="neutron nova") - - -@hooks.hook('zeromq-configuration-relation-changed') -@restart_on_change(restart_map(), stopstart=True) -def zeromq_configuration_relation_changed(): - CONFIGS.write_all() - - @hooks.hook('nrpe-external-master-relation-joined', 'nrpe-external-master-relation-changed') def update_nrpe_config(): diff --git a/hooks/neutron_utils.py b/hooks/neutron_utils.py index 60193c73..f7271600 100644 --- a/hooks/neutron_utils.py +++ b/hooks/neutron_utils.py @@ -248,7 +248,7 @@ GIT_PACKAGE_BLACKLIST = [ # The interface is said to be satisfied if anyone of the interfaces in the # list has a complete context. REQUIRED_INTERFACES = { - 'messaging': ['amqp', 'zeromq-configuration'], + 'messaging': ['amqp'], 'neutron-plugin-api': ['neutron-plugin-api'], 'network-service': ['quantum-network-service'], } @@ -886,27 +886,6 @@ def cleanup_ovs_netns(): log('Faild to cleanup ovs and netns, %s' % e, level=ERROR) -def get_topics(): - # metering_agent - topics = [] - if 'neutron-l3-agent' in services(): - topics.append('l3_agent') - if 'neutron-dhcp-agent' in services(): - topics.append('dhcp_agent') - if 'neutron-metering-agent' in services(): - topics.append('metering_agent') - if 'neutron-lbaas-agent' in services(): - topics.append('n-lbaas_agent') - if 'neutron-plugin-openvswitch-agent' in services(): - topics.append('q-agent-notifier-port-update') - topics.append('q-agent-notifier-network-delete') - topics.append('q-agent-notifier-tunnel-update') - topics.append('q-agent-notifier-security_group-update') - topics.append('q-agent-notifier-dvr-update') - topics.append('q-agent-notifier-l2population-update') - return topics - - def git_install(projects_yaml): """Perform setup, and install git repos specified in yaml parameter.""" if git_install_requested(): diff --git a/hooks/zeromq-configuration-relation-changed b/hooks/zeromq-configuration-relation-changed deleted file mode 120000 index fed1c963..00000000 --- a/hooks/zeromq-configuration-relation-changed +++ /dev/null @@ -1 +0,0 @@ -neutron_hooks.py \ No newline at end of file diff --git a/hooks/zeromq-configuration-relation-joined b/hooks/zeromq-configuration-relation-joined deleted file mode 120000 index fed1c963..00000000 --- a/hooks/zeromq-configuration-relation-joined +++ /dev/null @@ -1 +0,0 @@ -neutron_hooks.py \ No newline at end of file diff --git a/metadata.yaml b/metadata.yaml index b968c0df..9c70bb4f 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -33,9 +33,6 @@ requires: interface: rabbitmq amqp-nova: interface: rabbitmq - zeromq-configuration: - interface: zeromq-configuration - scope: container neutron-plugin-api: interface: neutron-plugin-api ha: diff --git a/unit_tests/test_neutron_hooks.py b/unit_tests/test_neutron_hooks.py index 77fcbaec..bf8ac1fe 100644 --- a/unit_tests/test_neutron_hooks.py +++ b/unit_tests/test_neutron_hooks.py @@ -157,13 +157,11 @@ class TestQuantumHooks(CharmTestCase): self.relation_ids.side_effect = mock_relids _amqp_joined = self.patch('amqp_joined') _amqp_nova_joined = self.patch('amqp_nova_joined') - _zmq_joined = self.patch('zeromq_configuration_relation_joined') self._call_hook('config-changed') self.assertTrue(self.do_openstack_upgrade.called) self.assertTrue(self.configure_ovs.called) self.assertTrue(_amqp_joined.called) self.assertTrue(_amqp_nova_joined.called) - self.assertTrue(_zmq_joined.called) self.assertTrue(self.create_sysctl.called) self.configure_apparmor.assert_called_with() @@ -210,7 +208,6 @@ class TestQuantumHooks(CharmTestCase): self.relation_ids.side_effect = mock_relids _amqp_joined = self.patch('amqp_joined') _amqp_nova_joined = self.patch('amqp_nova_joined') - _zmq_joined = self.patch('zeromq_configuration_relation_joined') repo = 'cloud:trusty-juno' openstack_origin_git = { 'repositories': [ @@ -233,7 +230,6 @@ class TestQuantumHooks(CharmTestCase): self.assertTrue(self.configure_ovs.called) self.assertTrue(_amqp_joined.called) self.assertTrue(_amqp_nova_joined.called) - self.assertTrue(_zmq_joined.called) self.assertTrue(self.create_sysctl.called) def test_upgrade_charm(self):