From 66b643524e8176dc0aa73c6efbaf2ed09726c8d9 Mon Sep 17 00:00:00 2001 From: James Page Date: Fri, 15 Dec 2017 16:47:22 +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: Ia11cd42eab112aa6dc609a5c15353ba98f6ae3ea --- hooks/neutron_api_hooks.py | 17 ++--------------- hooks/neutron_api_utils.py | 12 +----------- hooks/zeromq-configuration-relation-changed | 1 - hooks/zeromq-configuration-relation-joined | 1 - metadata.yaml | 3 --- unit_tests/test_neutron_api_hooks.py | 5 ----- 6 files changed, 3 insertions(+), 36 deletions(-) delete mode 120000 hooks/zeromq-configuration-relation-changed delete mode 120000 hooks/zeromq-configuration-relation-joined diff --git a/hooks/neutron_api_hooks.py b/hooks/neutron_api_hooks.py index 5a4f9d89..e6ef5a85 100755 --- a/hooks/neutron_api_hooks.py +++ b/hooks/neutron_api_hooks.py @@ -56,7 +56,6 @@ from charmhelpers.contrib.openstack.utils import ( configure_installation_source, git_install_requested, openstack_upgrade_available, - os_requires_version, os_release, sync_db_with_multi_ipv6_addresses, is_unit_paused_set, @@ -75,7 +74,6 @@ from neutron_api_utils import ( do_openstack_upgrade, dvr_router_present, force_etcd_restart, - get_topics, git_install, is_api_ready, l3ha_router_present, @@ -301,8 +299,6 @@ def config_changed(): amqp_joined(relation_id=r_id) for r_id in relation_ids('identity-service'): identity_joined(rid=r_id) - for rid in relation_ids('zeromq-configuration'): - zeromq_configuration_relation_joined(rid) [cluster_joined(rid) for rid in relation_ids('cluster')] @@ -641,14 +637,6 @@ def ha_changed(): neutron_api_relation_joined(rid=rid) -@hooks.hook('zeromq-configuration-relation-joined') -@os_requires_version('kilo', 'neutron-server') -def zeromq_configuration_relation_joined(relid=None): - relation_set(relation_id=relid, - topics=" ".join(get_topics()), - users="neutron") - - @hooks.hook('neutron-plugin-api-subordinate-relation-joined', 'neutron-plugin-api-subordinate-relation-changed') @restart_on_change(restart_map(), stopstart=True) @@ -667,10 +655,9 @@ def neutron_plugin_api_subordinate_relation_joined(relid=None): CONFIGS.write(API_PASTE_INI) -@hooks.hook('zeromq-configuration-relation-changed', - 'neutron-plugin-api-subordinate-relation-changed') +@hooks.hook('neutron-plugin-api-subordinate-relation-changed') @restart_on_change(restart_map(), stopstart=True) -def zeromq_configuration_relation_changed(): +def neutron_plugin_api_relation_changed(): CONFIGS.write_all() diff --git a/hooks/neutron_api_utils.py b/hooks/neutron_api_utils.py index d12f231a..06a7166f 100755 --- a/hooks/neutron_api_utils.py +++ b/hooks/neutron_api_utils.py @@ -223,7 +223,7 @@ BASE_RESOURCE_MAP = OrderedDict([ # list has a complete context. REQUIRED_INTERFACES = { 'database': ['shared-db', 'pgsql-db'], - 'messaging': ['amqp', 'zeromq-configuration'], + 'messaging': ['amqp'], 'identity': ['identity-service'], } @@ -662,16 +662,6 @@ def migrate_neutron_database(upgrade=False): relation_set(relation_id=r_id, **{NEUTRON_DB_INIT_RKEY: id}) -def get_topics(): - return ['q-l3-plugin', - 'q-firewall-plugin', - 'n-lbaas-plugin', - 'ipsec_driver', - 'q-metering-plugin', - 'q-plugin', - 'neutron'] - - def setup_ipv6(): ubuntu_rel = lsb_release()['DISTRIB_CODENAME'].lower() if CompareHostReleases(ubuntu_rel) < "trusty": diff --git a/hooks/zeromq-configuration-relation-changed b/hooks/zeromq-configuration-relation-changed deleted file mode 120000 index 1fb10fd5..00000000 --- a/hooks/zeromq-configuration-relation-changed +++ /dev/null @@ -1 +0,0 @@ -neutron_api_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 1fb10fd5..00000000 --- a/hooks/zeromq-configuration-relation-joined +++ /dev/null @@ -1 +0,0 @@ -neutron_api_hooks.py \ No newline at end of file diff --git a/metadata.yaml b/metadata.yaml index 41ef3b95..f65e6397 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -45,9 +45,6 @@ requires: scope: container vsd-rest-api: interface: vsd-rest-api - zeromq-configuration: - interface: zeromq-configuration - scope: container neutron-plugin-api-subordinate: interface: neutron-plugin-api-subordinate scope: container diff --git a/unit_tests/test_neutron_api_hooks.py b/unit_tests/test_neutron_api_hooks.py index a28a50fc..50c68e7c 100644 --- a/unit_tests/test_neutron_api_hooks.py +++ b/unit_tests/test_neutron_api_hooks.py @@ -76,7 +76,6 @@ TO_PATCH = [ 'open_port', 'openstack_upgrade_available', 'os_release', - 'os_requires_version', 'relation_get', 'relation_ids', 'relation_set', @@ -235,14 +234,12 @@ class NeutronAPIHooksTests(CharmTestCase): _amqp_rel_joined = self.patch('amqp_joined') _id_rel_joined = self.patch('identity_joined') _id_cluster_joined = self.patch('cluster_joined') - _zmq_joined = self.patch('zeromq_configuration_relation_joined') self._call_hook('config-changed') self.assertTrue(_n_api_rel_joined.called) self.assertTrue(_n_plugin_api_rel_joined.called) self.assertTrue(_amqp_rel_joined.called) self.assertTrue(_id_rel_joined.called) self.assertTrue(_id_cluster_joined.called) - self.assertTrue(_zmq_joined.called) self.assertTrue(self.CONFIGS.write_all.called) self.assertTrue(self.do_openstack_upgrade.called) self.assertTrue(self.apt_install.called) @@ -279,7 +276,6 @@ class NeutronAPIHooksTests(CharmTestCase): _amqp_rel_joined = self.patch('amqp_joined') _id_rel_joined = self.patch('identity_joined') _id_cluster_joined = self.patch('cluster_joined') - _zmq_joined = self.patch('zeromq_configuration_relation_joined') repo = 'cloud:trusty-juno' openstack_origin_git = { 'repositories': [ @@ -308,7 +304,6 @@ class NeutronAPIHooksTests(CharmTestCase): self.assertTrue(_n_plugin_api_rel_joined.called) self.assertTrue(_amqp_rel_joined.called) self.assertTrue(_id_rel_joined.called) - self.assertTrue(_zmq_joined.called) self.assertTrue(_id_cluster_joined.called) @patch.object(hooks, 'git_install_requested')