def vrf_leak(vrf, bgp_as, bgp_router_id=None):
    LOG.info('Add VRF leak for VRF {} on router bgp {}'.format(vrf, bgp_as))
    if (not bgp_router_id):
        bgp_router_id = _get_router_id(bgp_as)
        if (not bgp_router_id):
            LOG.error('Unknown router-id, needed for route leaking')
            return
    vrf_template = Template(LEAK_VRF_TEMPLATE)
    vrf_config = vrf_template.render(vrf_name=vrf, bgp_as=bgp_as, bgp_router_id=bgp_router_id)
    frr_config_file = 'frr-config-vrf-leak-{}'.format(vrf)
    with open(frr_config_file, 'w') as vrf_config_file:
        vrf_config_file.write(vrf_config)
    _run_vtysh_config(frr_config_file)
def vrf_leak(vrf, bgp_as, bgp_router_id=None):
    LOG.info('Add VRF leak for VRF {} on router bgp {}'.format(vrf, bgp_as))
    if (not bgp_router_id):
        bgp_router_id = _get_router_id(bgp_as)
        if (not bgp_router_id):
            LOG.error('Unknown router-id, needed for route leaking')
            return
    vrf_template = Template(LEAK_VRF_TEMPLATE)
    vrf_config = vrf_template.render(vrf_name=vrf, bgp_as=bgp_as, bgp_router_id=bgp_router_id)
    frr_config_file = 'frr-config-vrf-leak-{}'.format(vrf)
    with open(frr_config_file, 'w') as vrf_config_file:
        vrf_config_file.write(vrf_config)
    _run_vtysh_config(frr_config_file)