diff --git a/hooks/charmhelpers/contrib/storage/linux/ceph.py b/hooks/charmhelpers/contrib/storage/linux/ceph.py index 6ec67cba..2e1fc1b5 100644 --- a/hooks/charmhelpers/contrib/storage/linux/ceph.py +++ b/hooks/charmhelpers/contrib/storage/linux/ceph.py @@ -158,19 +158,15 @@ def get_osd_settings(relation_name): return _order_dict_by_key(osd_settings) -def send_application_name(relid=None, app_name=None): +def send_application_name(relid=None): """Send the application name down the relation. :param relid: Relation id to set application name in. :type relid: str - :param app_name: Application name to send in the relation. - :type app_name: str """ - if app_name is None: - app_name = application_name() relation_set( relation_id=relid, - relation_settings={'application-name': app_name}) + relation_settings={'application-name': application_name()}) def send_osd_settings(): diff --git a/hooks/nova_compute_context.py b/hooks/nova_compute_context.py index ff8146a8..c6ab5f82 100644 --- a/hooks/nova_compute_context.py +++ b/hooks/nova_compute_context.py @@ -63,7 +63,7 @@ from charmhelpers.contrib.network.ip import ( # This is just a label and it must be consistent across # nova-compute nodes to support live migration. -CEPH_SECRET_UUID = 'c91ce26f-403d-4058-9c38-6b56e1c428e0' +CEPH_SECRET_UUID = '514c9fca-8cbe-11e2-9c52-3bc8c7819472' OVS_BRIDGE = 'br-int' @@ -435,7 +435,7 @@ class NovaComputeCephContext(context.CephContext): ctxt = super(NovaComputeCephContext, self).__call__() if not ctxt: return {} - svc = 'nova-compute' + svc = service_name() # secret.xml ctxt['ceph_secret_uuid'] = CEPH_SECRET_UUID # nova.conf diff --git a/hooks/nova_compute_hooks.py b/hooks/nova_compute_hooks.py index 42e35ba4..e4f4600a 100755 --- a/hooks/nova_compute_hooks.py +++ b/hooks/nova_compute_hooks.py @@ -454,7 +454,7 @@ def ceph_joined(): # Bug 1427660 if not is_unit_paused_set() and config('virt-type') in LIBVIRT_TYPES: service_restart(libvirt_daemon()) - send_application_name(app_name='nova-compute') + send_application_name() def get_ceph_request(): @@ -566,7 +566,7 @@ def ceph_changed(rid=None, unit=None): log('ceph relation incomplete. Peer not ready?') return - if not ensure_ceph_keyring(service='nova-compute', user='nova', + if not ensure_ceph_keyring(service=service_name(), user='nova', group='nova'): log('Could not create ceph keyring: peer not ready?') return @@ -691,11 +691,8 @@ def _get_broker_rid_unit_for_previous_request(): @hooks.hook('ceph-relation-broken') def ceph_broken(): - delete_keyring(service='nova-compute') - # cleanup old entries based on application name - svc_name = service_name() - if svc_name != 'nova_compute': - delete_keyring(service=svc_name) + service = service_name() + delete_keyring(service=service) update_all_configs() @@ -721,9 +718,6 @@ def upgrade_charm(): for r_id in relation_ids('amqp'): amqp_joined(relation_id=r_id) - # Trigger upgrade-path from application_name to 'nova-compute' - for r_id in relation_ids('ceph'): - send_application_name(relid=r_id, app_name='nova-compute') if is_relation_made('nrpe-external-master'): update_nrpe_config() diff --git a/unit_tests/test_nova_compute_hooks.py b/unit_tests/test_nova_compute_hooks.py index 00c18acc..ffb95cdc 100644 --- a/unit_tests/test_nova_compute_hooks.py +++ b/unit_tests/test_nova_compute_hooks.py @@ -598,8 +598,7 @@ class NovaComputeRelationsTests(CharmTestCase): self.apt_install.assert_called_with(['ceph-common'], fatal=True) self.service_restart.assert_called_with('libvirt-bin') self.libvirt_daemon.assert_called() - self.send_application_name.assert_called_once_with( - app_name='nova-compute') + self.send_application_name.assert_called_once_with() @patch.object(hooks, 'CONFIGS') def test_ceph_changed_missing_relation_data(self, configs):