Ejemplo n.º 1
0
    def setUp(self):
        super(ReservationPoolTestCase, self).setUp()
        config.parse_configs()
        self.pool_name = 'pool-name-xxx'
        self.tenant_id = 'tenant-uuid'
        self.fake_aggregate = AggregateFake(i=123,
                                            name='fooname',
                                            hosts=['host1', 'host2'])
        self.freepool_name = cfg.CONF['physical:host'].aggregate_freepool_name
        self.tenant_id_key = cfg.CONF['physical:host'].tenant_id_key
        self.climate_owner = cfg.CONF['physical:host'].climate_owner
        self.climate_az_prefix = cfg.CONF['physical:host'].climate_az_prefix

        self.fake_freepool = AggregateFake(i=456,
                                           name=self.freepool_name,
                                           hosts=['host3'])

        self.set_context(context.ClimateContext(tenant_id=self.tenant_id))

        self.nova_client = nova_client
        self.nova = self.patch(self.nova_client, 'Client').return_value

        self.patch(self.nova.aggregates, 'set_metadata')
        self.patch(self.nova.aggregates, 'remove_host')

        self.pool = rp.ReservationPool()

        self.p_name = self.patch(self.pool, '_generate_aggregate_name')
        self.p_name.return_value = self.pool_name
Ejemplo n.º 2
0
def main():
    """Entry point to start Climate API wsgi server."""
    dev_conf = os.path.join(possible_topdir, 'etc', 'climate', 'climate.conf')
    config_files = None

    if os.path.exists(dev_conf):
        config_files = [dev_conf]

    config.parse_configs(sys.argv[1:], config_files)
    service_utils.prepare_service(sys.argv)
    logging.setup("climate")
    app = server.make_app()

    wsgi.server(eventlet.listen((cfg.CONF.host, cfg.CONF.port), backlog=500),
                app)
Ejemplo n.º 3
0
def main():
    """Entry point to start Climate API wsgi server."""
    possible_topdir = os.path.join(os.path.abspath(sys.argv[0]),
                                   os.pardir, os.pardir)
    possible_topdir = os.path.normpath(possible_topdir)

    dev_conf = os.path.join(possible_topdir, 'etc', 'climate', 'climate.conf')
    config_files = None

    if os.path.exists(dev_conf):
        config_files = [dev_conf]

    config.parse_configs(sys.argv[1:], config_files)
    service_utils.prepare_service(sys.argv)
    logging.setup("climate")
    app = api_app.make_app()

    wsgi.server(eventlet.listen((CONF.host, CONF.port), backlog=500), app)