예제 #1
0
def ceph_changed():
    if 'ceph' not in CONFIGS.complete_contexts():
        juju_log('ceph relation incomplete. Peer not ready?')
        return

    service = service_name()

    if not ensure_ceph_keyring(service=service,
                               user='******', group='glance'):
        juju_log('Could not create ceph keyring: peer not ready?')
        return

    CONFIGS.write(GLANCE_API_CONF)
    CONFIGS.write(CEPH_CONF)

    if eligible_leader(CLUSTER_RES):
        _config = config()
        ensure_ceph_pool(service=service,
                         replicas=_config['ceph-osd-replication-count'])
예제 #2
0
 def test_ensure_ceph_pool_already_exists(self):
     self.ceph_pool_exists.return_value = True
     utils.ensure_ceph_pool(service='glance', replicas=3)
     self.assertFalse(self.ceph_create_pool.called)
예제 #3
0
 def test_ensure_ceph_pool(self):
     self.ceph_pool_exists.return_value = False
     utils.ensure_ceph_pool(service='glance', replicas=3)
     self.ceph_create_pool.assert_called_with(service='glance',
                                              name='glance',
                                              replicas=3)