def register_bgp_dragent(host=helpers.HOST, admin_state_up=True, alive=True): agent = helpers._register_agent(_get_bgp_dragent_dict(host)) if not admin_state_up: helpers.set_agent_admin_state(agent['id']) if not alive: helpers.kill_agent(agent['id']) return helpers.FakePlugin()._get_agent_by_type_and_host( context.get_admin_context(), agent['agent_type'], agent['host'])
def get_l3_agent_by_host(self, agent_host): plugin = helpers.FakePlugin() return plugin._get_agent_by_type_and_host(self.ctx, constants.AGENT_TYPE_L3, agent_host)