示例#1
0
    def __init__(self, conf):
        super(LbaasAgentManager, self).__init__()
        self.conf = conf
        self.context = ncontext.get_admin_context_without_session()
        self.plugin_rpc = agent_api.LbaasAgentApi(topics.LOADBALANCER_PLUGIN,
                                                  self.context, self.conf.host)
        self._load_drivers()

        self.agent_state = {
            'binary': 'neutron-lbaas-agent',
            'host': conf.host,
            'topic': topics.LOADBALANCER_AGENT,
            'configurations': {
                'device_drivers': self.device_drivers.keys()
            },
            'agent_type': n_const.AGENT_TYPE_LOADBALANCER,
            'start_flag': True
        }
        self.admin_state_up = True

        self._setup_state_rpc()
        self.needs_resync = False
        # pool_id->device_driver_name mapping used to store known instances
        self.instance_mapping = {}
示例#2
0
    def setUp(self):
        super(TestApiCache, self).setUp()

        self.api = api.LbaasAgentApi('topic', mock.sentinel.context, 'host')