def ceph_changed(): if 'ceph' not in CONFIGS.complete_contexts(): juju_log('ceph relation incomplete. Peer not ready?') return svc = service_name() if not ensure_ceph_keyring(service=svc, user='******', group='cinder'): juju_log('Could not create ceph keyring: peer not ready?') return CONFIGS.write(CEPH_CONF) CONFIGS.write(CINDER_CONF) set_ceph_env_variables(service=svc) if eligible_leader(CLUSTER_RES): _config = config() ensure_ceph_pool(service=svc, replicas=_config['ceph-osd-replication-count'])
def test_ensure_ceph_pool_already_exists(self): self.ceph_pool_exists.return_value = True cinder_utils.ensure_ceph_pool(service='cinder', replicas=3) self.assertFalse(self.ceph_create_pool.called)
def test_ensure_ceph_pool(self): self.ceph_pool_exists.return_value = False cinder_utils.ensure_ceph_pool(service='cinder', replicas=3) self.ceph_create_pool.assert_called_with(service='cinder', name='cinder', replicas=3)