def __init__(self, conf): super(LbaasAgentManager, self).__init__(conf) self.conf = conf self.context = ncontext.get_admin_context_without_session() self.serializer = agent_driver_base.DataModelSerializer() self.plugin_rpc = agent_api.LbaasAgentApi( lb_const.LOADBALANCER_PLUGINV2, self.context, self.conf.host) self._load_drivers() self.agent_state = { 'binary': 'neutron-lbaasv2-agent', 'host': conf.host, 'topic': lb_const.LOADBALANCER_AGENTV2, 'configurations': { 'device_drivers': self.device_drivers.keys() }, 'agent_type': lb_const.AGENT_TYPE_LOADBALANCERV2, '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 = {}
def setUp(self): super(TestApiCache, self).setUp() self.api = api.LbaasAgentApi('topic', mock.sentinel.context, 'host')