예제 #1
0
    def setUp(self):
        super(BgpTestCase, self).setUp()
        self.conf = self.useFixture(oslo_fixture.Config(config.cfg.CONF))
        self.conf.config(group="haproxy_amphora", base_path='/var/lib/octavia')
        self.conf.config(group="controller_worker",
                         loadbalancer_topology=consts.TOPOLOGY_ACTIVE_ACTIVE)
        with mock.patch('distro.id', return_value='ubuntu'):
            self.ubuntu_test_server = server.Server()
            self.ubuntu_app = self.ubuntu_test_server.app.test_client()

        with mock.patch('distro.id', return_value='centos'):
            self.centos_test_server = server.Server()
            self.centos_app = self.centos_test_server.app.test_client()
예제 #2
0
def main():
    # comment out to improve logging
    service.prepare_service(sys.argv)

    gmr.TextGuruMeditation.setup_autorun(version)

    health_sender_proc = multiproc.Process(name='HM_sender',
                                           target=health_daemon.run_sender,
                                           args=(HM_SENDER_CMD_QUEUE,))
    health_sender_proc.daemon = True
    health_sender_proc.start()

    # Initiate server class
    server_instance = server.Server()

    bind_ip_port = utils.ip_port_str(CONF.haproxy_amphora.bind_host,
                                     CONF.haproxy_amphora.bind_port)
    options = {
        'bind': bind_ip_port,
        'workers': 1,
        'timeout': CONF.amphora_agent.agent_request_read_timeout,
        'certfile': CONF.amphora_agent.agent_server_cert,
        'ca_certs': CONF.amphora_agent.agent_server_ca,
        'cert_reqs': True,
        'preload_app': True,
        'accesslog': '/var/log/amphora-agent.log',
        'errorlog': '/var/log/amphora-agent.log',
        'loglevel': 'debug',
    }
    AmphoraAgent(server_instance.app, options).run()
예제 #3
0
파일: agent.py 프로젝트: zwyw610/octavia
def main():
    # comment out to improve logging
    service.prepare_service(sys.argv)

    gmr.TextGuruMeditation.setup_autorun(version)

    health_sender_proc = multiproc.Process(name='HM_sender',
                                           target=health_daemon.run_sender,
                                           args=(HM_SENDER_CMD_QUEUE, ))
    health_sender_proc.daemon = True
    health_sender_proc.start()

    # Initiate server class
    server_instance = server.Server()

    bind_ip_port = utils.ip_port_str(CONF.haproxy_amphora.bind_host,
                                     CONF.haproxy_amphora.bind_port)
    proto = CONF.amphora_agent.agent_tls_protocol.replace('.', '_')
    options = {
        'bind':
        bind_ip_port,
        'workers':
        1,
        'timeout':
        CONF.amphora_agent.agent_request_read_timeout,
        'certfile':
        CONF.amphora_agent.agent_server_cert,
        'ca_certs':
        CONF.amphora_agent.agent_server_ca,
        'cert_reqs':
        True,
        'ssl_version':
        getattr(ssl, "PROTOCOL_%s" % proto),
        'preload_app':
        True,
        'accesslog':
        '/var/log/amphora-agent.log',
        'errorlog':
        '/var/log/amphora-agent.log',
        'loglevel':
        'debug',
        'syslog':
        True,
        'syslog_facility':
        'local{}'.format(CONF.amphora_agent.administrative_log_facility),
        'syslog_addr':
        'unix://run/rsyslog/octavia/log#dgram',
    }
    AmphoraAgent(server_instance.app, options).run()