def test_create_rgw_pools_rq_no_prefix_pre_jewel(self, mock_broker): self.test_config.set('rgw-lightweight-pool-pg-num', -1) self.test_config.set('ceph-osd-replication-count', 3) self.test_config.set('rgw-buckets-pool-weight', 19) ceph.get_create_rgw_pools_rq(prefix=None) mock_broker.assert_has_calls([ call(weight=19, replica_count=3, name='.rgw.buckets', group='objects'), call(weight=0.10, replica_count=3, name='.rgw', group='objects'), call(weight=0.10, replica_count=3, name='.rgw.root', group='objects'), call(weight=0.10, replica_count=3, name='.rgw.control', group='objects'), call(weight=0.10, replica_count=3, name='.rgw.gc', group='objects'), call(weight=1.00, replica_count=3, name='.rgw.buckets.index', group='objects'), call(weight=1.00, replica_count=3, name='.rgw.buckets.extra', group='objects'), call(weight=0.10, replica_count=3, name='.log', group='objects'), call(weight=0.10, replica_count=3, name='.intent-log', group='objects'), call(weight=0.10, replica_count=3, name='.usage', group='objects'), call(weight=0.10, replica_count=3, name='.users', group='objects'), call(weight=0.10, replica_count=3, name='.users.email', group='objects'), call(weight=0.10, replica_count=3, name='.users.swift', group='objects'), call(weight=0.10, replica_count=3, name='.users.uid', group='objects')] )
def test_create_rgw_pools_rq_no_prefix_post_jewel(self, mock_broker, mock_request_access): self.test_config.set('rgw-lightweight-pool-pg-num', -1) self.test_config.set('ceph-osd-replication-count', 3) self.test_config.set('rgw-buckets-pool-weight', 19) self.test_config.set('restrict-ceph-pools', True) ceph.get_create_rgw_pools_rq(prefix=None) mock_broker.assert_has_calls([ call(weight=19, replica_count=3, name='default.rgw.buckets', group='objects'), call(weight=0.10, replica_count=3, name='default.rgw', group='objects'), call(weight=0.10, replica_count=3, name='default.rgw.root', group='objects'), call(weight=0.10, replica_count=3, name='default.rgw.control', group='objects'), call(weight=0.10, replica_count=3, name='default.rgw.gc', group='objects'), call(weight=1.00, replica_count=3, name='default.rgw.buckets.index', group='objects'), call(weight=1.00, replica_count=3, name='default.rgw.buckets.extra', group='objects'), call(weight=0.10, replica_count=3, name='default.log', group='objects'), call(weight=0.10, replica_count=3, name='default.intent-log', group='objects'), call(weight=0.10, replica_count=3, name='default.usage', group='objects'), call(weight=0.10, replica_count=3, name='default.users', group='objects'), call(weight=0.10, replica_count=3, name='default.users.email', group='objects'), call(weight=0.10, replica_count=3, name='default.users.swift', group='objects'), call(weight=0.10, replica_count=3, name='default.users.uid', group='objects'), call(weight=0.10, replica_count=3, name='.rgw.root', group='objects')] ) mock_request_access.assert_called_with(key_name='radosgw.gateway', name='objects', permission='rwx')
def mon_relation(rid=None, unit=None): rq = ceph.get_create_rgw_pools_rq(prefix=config('pool-prefix')) if is_request_complete(rq, relation='mon'): log('Broker request complete', level=DEBUG) CONFIGS.write_all() key = relation_get(attribute='radosgw_key', rid=rid, unit=unit) if key: ceph.import_radosgw_key(key) if not is_unit_paused_set(): restart() # TODO figure out a better way todo this else: send_request_if_needed(rq, relation='mon')
def test_create_rgw_pools_rq_with_prefix(self, mock_broker): self.test_config.set('rgw-lightweight-pool-pg-num', 10) self.test_config.set('ceph-osd-replication-count', 3) self.test_config.set('rgw-buckets-pool-weight', 19) ceph.get_create_rgw_pools_rq(prefix='us-east') mock_broker.assert_has_calls([ call(replica_count=3, weight=19, name='us-east.rgw.buckets', group='objects'), call(pg_num=10, replica_count=3, name='us-east.rgw', group='objects'), call(pg_num=10, replica_count=3, name='us-east.rgw.root', group='objects'), call(pg_num=10, replica_count=3, name='us-east.rgw.control', group='objects'), call(pg_num=10, replica_count=3, name='us-east.rgw.gc', group='objects'), call(pg_num=10, replica_count=3, name='us-east.rgw.buckets.index', group='objects'), call(pg_num=10, replica_count=3, name='us-east.rgw.buckets.extra', group='objects'), call(pg_num=10, replica_count=3, name='us-east.log', group='objects'), call(pg_num=10, replica_count=3, name='us-east.intent-log', group='objects'), call(pg_num=10, replica_count=3, name='us-east.usage', group='objects'), call(pg_num=10, replica_count=3, name='us-east.users', group='objects'), call(pg_num=10, replica_count=3, name='us-east.users.email', group='objects'), call(pg_num=10, replica_count=3, name='us-east.users.swift', group='objects'), call(pg_num=10, replica_count=3, name='us-east.users.uid', group='objects'), call(pg_num=10, replica_count=3, name='.rgw.root', group='objects')] )