def test_producer_rpc_topic(self): CONF.set_override('topic', 'test-topic', 'service:producer') self.service = service.Service() self.assertEqual('test-topic', self.service.rpc_topic) self.assertEqual('producer', self.service.service_name)
def main(): utils.read_config('designate', sys.argv) logging.setup(CONF, 'designate') gmr.TextGuruMeditation.setup_autorun(version) # NOTE(timsim): This is to ensure people don't start the wrong # services when the worker model is enabled. if CONF['service:worker'].enabled: LOG.error('You have designate-worker enabled, starting ' 'designate-zone-manager is incompatible with ' 'designate-worker. You need to start ' 'designate-producer instead.') sys.exit(1) debtcollector.deprecate( 'designate-zone-manager Is deprecated in ' 'favor of the designate-producer', version='newton', removal_version='rocky') LOG.warning('Starting designate-producer under the zone-manager name') server = producer_service.Service( threads=CONF['service:zone_manager'].threads) service.serve(server, workers=CONF['service:zone_manager'].workers) server.heartbeat_emitter.start() service.wait()
def main(): utils.read_config('designate', sys.argv) logging.setup(CONF, 'designate') gmr.TextGuruMeditation.setup_autorun(version) hookpoints.log_hook_setup() server = producer_service.Service() heartbeat = service.Heartbeat(server.service_name, server.tg) service.serve(server, workers=CONF['service:producer'].workers) heartbeat.start() service.wait()
def main(): utils.read_config('designate', sys.argv) logging.setup(CONF, 'designate') gmr.TextGuruMeditation.setup_autorun(version) # NOTE(timsim): This is to ensure people don't start the wrong # services when the worker model is enabled. if not cfg.CONF['service:worker'].enabled: LOG.error('You do not have designate-worker enabled, starting ' 'designate-producer is not allowed. ' 'You need to start designate-zone-manager instead.') sys.exit(1) hookpoints.log_hook_setup() server = producer_service.Service(threads=CONF['service:producer'].threads) service.serve(server, workers=CONF['service:producer'].workers) service.wait()
def setUp(self): self.useFixture(cfg_fixture.Config(CONF)) service.CONF = RoObject({ 'service:producer': RoObject({ 'enabled_tasks': None, # enable all tasks }), 'producer_task:zone_purge': '', }) super(ProducerTest, self).setUp() self.stdlog = fixtures.StandardLogging() self.useFixture(self.stdlog) self.service = service.Service() self.service.rpc_server = mock.Mock() self.service._storage = mock.Mock() self.service._quota = mock.Mock() self.service._quota.limit_check = mock.Mock()
def setUp(self): self.useFixture(cfg_fixture.Config(CONF)) service.CONF = RoObject({ 'service:producer': RoObject({ 'enabled_tasks': None, # enable all tasks }), # TODO(timsim): Remove this 'service:zone_manager': RoObject({ 'enabled_tasks': None, # enable all tasks 'export_synchronous': True }), 'producer_task:zone_purge': '', }) super(ProducerTest, self).setUp() self.service = service.Service() self.service._storage = mock.Mock() self.service._rpc_server = mock.Mock() self.service._quota = mock.Mock() self.service.quota.limit_check = mock.Mock()
def main(): utils.read_config('designate', sys.argv) logging.setup(CONF, 'designate') gmr.TextGuruMeditation.setup_autorun(version) # NOTE(timsim): This is to ensure people don't start the wrong # services when the worker model is enabled. if cfg.CONF['service:worker'].enabled: LOG.error( _LE('You have designate-worker enabled, starting ' 'designate-zone-manager is incompatible with ' 'designate-worker. You need to start ' 'designate-producer instead.')) sys.exit(1) LOG.warning( _LW('designate-zone-manager is DEPRECATED in favor of ' 'designate-producer, starting designate-producer ' 'under the zone-manager name')) server = producer_service.Service( threads=CONF['service:zone_manager'].threads) service.serve(server, workers=CONF['service:zone_manager'].workers) service.wait()