From 97b7b8d31c5c7c783c3ee4b8b0b25cc7280576ec Mon Sep 17 00:00:00 2001 From: James Page Date: Thu, 7 Dec 2017 14:19:34 +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 issues in 17.02 charm release. Change-Id: I66330dd29972e39e45e9bf81cb0570d5749b8312 --- hooks/nova_compute_hooks.py | 18 ------------------ hooks/nova_compute_utils.py | 6 +----- hooks/zeromq-configuration-relation-changed | 1 - hooks/zeromq-configuration-relation-joined | 1 - metadata.yaml | 3 --- unit_tests/test_nova_compute_hooks.py | 6 ------ 6 files changed, 1 insertion(+), 34 deletions(-) delete mode 120000 hooks/zeromq-configuration-relation-changed delete mode 120000 hooks/zeromq-configuration-relation-joined diff --git a/hooks/nova_compute_hooks.py b/hooks/nova_compute_hooks.py index 65a6bc61..fd70129c 100755 --- a/hooks/nova_compute_hooks.py +++ b/hooks/nova_compute_hooks.py @@ -56,7 +56,6 @@ from charmhelpers.contrib.openstack.utils import ( configure_installation_source, git_install_requested, openstack_upgrade_available, - os_requires_version, is_unit_paused_set, pausable_restart_on_change as restart_on_change, ) @@ -90,7 +89,6 @@ from nova_compute_utils import ( enable_shell, disable_shell, configure_lxd, fix_path_ownership, - get_topics, assert_charm_supports_ipv6, install_hugepages, get_hugepage_number, @@ -196,8 +194,6 @@ def config_changed(): fix_path_ownership(fp, user='nova') [compute_joined(rid) for rid in relation_ids('cloud-compute')] - for rid in relation_ids('zeromq-configuration'): - zeromq_configuration_relation_joined(rid) for rid in relation_ids('neutron-plugin'): neutron_plugin_joined(rid, remote_restart=send_remote_restart) @@ -451,20 +447,6 @@ def nova_ceilometer_relation_changed(): CONFIGS.write_all() -@hooks.hook('zeromq-configuration-relation-joined') -@os_requires_version('kilo', 'nova-common') -def zeromq_configuration_relation_joined(relid=None): - relation_set(relation_id=relid, - topics=" ".join(get_topics()), - users="nova") - - -@hooks.hook('zeromq-configuration-relation-changed') -@restart_on_change(restart_map()) -def zeromq_configuration_relation_changed(): - CONFIGS.write(NOVA_CONF) - - @hooks.hook('nrpe-external-master-relation-joined', 'nrpe-external-master-relation-changed') def update_nrpe_config(): diff --git a/hooks/nova_compute_utils.py b/hooks/nova_compute_utils.py index 7c3ef9a7..bfdb7ccd 100644 --- a/hooks/nova_compute_utils.py +++ b/hooks/nova_compute_utils.py @@ -304,7 +304,7 @@ LIBVIRT_URIS = { # 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'], 'image': ['image-service'], } @@ -734,10 +734,6 @@ def fix_path_ownership(path, user='nova'): check_call(cmd) -def get_topics(): - return ['compute'] - - def assert_charm_supports_ipv6(): """Check whether we are able to support charms ipv6.""" _release = lsb_release()['DISTRIB_CODENAME'].lower() diff --git a/hooks/zeromq-configuration-relation-changed b/hooks/zeromq-configuration-relation-changed deleted file mode 120000 index 3ba0bdea..00000000 --- a/hooks/zeromq-configuration-relation-changed +++ /dev/null @@ -1 +0,0 @@ -nova_compute_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 3ba0bdea..00000000 --- a/hooks/zeromq-configuration-relation-joined +++ /dev/null @@ -1 +0,0 @@ -nova_compute_hooks.py \ No newline at end of file diff --git a/metadata.yaml b/metadata.yaml index c9fd982e..8f222644 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -45,9 +45,6 @@ requires: neutron-plugin: interface: neutron-plugin scope: container - zeromq-configuration: - interface: zeromq-configuration - scope: container ephemeral-backend: interface: ephemeral-backend scope: container diff --git a/unit_tests/test_nova_compute_hooks.py b/unit_tests/test_nova_compute_hooks.py index 13c7b7ac..a7ced95f 100644 --- a/unit_tests/test_nova_compute_hooks.py +++ b/unit_tests/test_nova_compute_hooks.py @@ -183,7 +183,6 @@ class NovaComputeRelationsTests(CharmTestCase): neutron_plugin_joined): self.git_install_requested.return_value = False self.migration_enabled.return_value = True - _zmq_joined = self.patch('zeromq_configuration_relation_joined') self.test_config.set('migration-auth-type', 'ssh') self.relation_ids.return_value = [ 'cloud-compute:0', @@ -196,7 +195,6 @@ class NovaComputeRelationsTests(CharmTestCase): ] self.assertEqual(ex, compute_joined.call_args_list) self.assertTrue(self.initialize_ssh_keys.called) - self.assertTrue(_zmq_joined.called) @patch.object(hooks, 'neutron_plugin_joined') @patch.object(hooks, 'compute_joined') @@ -204,7 +202,6 @@ class NovaComputeRelationsTests(CharmTestCase): neutron_plugin_joined): self.git_install_requested.return_value = False self.test_config.set('enable-resize', True) - _zmq_joined = self.patch('zeromq_configuration_relation_joined') self.migration_enabled.return_value = False self.relation_ids.return_value = [ 'cloud-compute:0', @@ -218,7 +215,6 @@ class NovaComputeRelationsTests(CharmTestCase): self.assertEqual(ex, compute_joined.call_args_list) self.initialize_ssh_keys.assert_called_with(user='nova') self.enable_shell.assert_called_with(user='nova') - self.assertTrue(_zmq_joined.called) @patch.object(hooks, 'neutron_plugin_joined') @patch.object(hooks, 'compute_joined') @@ -227,7 +223,6 @@ class NovaComputeRelationsTests(CharmTestCase): self.git_install_requested.return_value = False self.test_config.set('enable-resize', False) self.migration_enabled.return_value = False - _zmq_joined = self.patch('zeromq_configuration_relation_joined') self.relation_ids.return_value = [ 'cloud-compute:0', 'cloud-compute:1' @@ -239,7 +234,6 @@ class NovaComputeRelationsTests(CharmTestCase): ] self.assertEqual(ex, compute_joined.call_args_list) self.disable_shell.assert_called_with(user='nova') - self.assertTrue(_zmq_joined.called) @patch.object(hooks, 'compute_joined') def test_config_changed_no_upgrade_no_migration(self, compute_joined):