def vrf_reconfigure(evpn_info, action):
    LOG.info('FRR reconfiguration (action = {}) for evpn: {}'.format(action, evpn_info))
    frr_config_file = None
    if (action == 'add-vrf'):
        vrf_template = Template(ADD_VRF_TEMPLATE)
        vrf_config = vrf_template.render(vrf_name='{}{}'.format(constants.OVN_EVPN_VRF_PREFIX, evpn_info['vni']), bgp_as=evpn_info['bgp_as'], vni=evpn_info['vni'])
        frr_config_file = 'frr-config-add-vrf-{}'.format(evpn_info['vni'])
    elif (action == 'del-vrf'):
        vrf_template = Template(DEL_VRF_TEMPLATE)
        vrf_config = vrf_template.render(vrf_name='{}{}'.format(constants.OVN_EVPN_VRF_PREFIX, evpn_info['vni']), bgp_as=evpn_info['bgp_as'])
        frr_config_file = 'frr-config-del-vrf-{}'.format(evpn_info['vni'])
    else:
        LOG.error('Unknown FRR reconfiguration action: %s', action)
        return
    with open(frr_config_file, 'w') as vrf_config_file:
        vrf_config_file.write(vrf_config)
    _run_vtysh_config(frr_config_file)
def vrf_reconfigure(evpn_info, action):
    LOG.info('FRR reconfiguration (action = {}) for evpn: {}'.format(action, evpn_info))
    frr_config_file = None
    if (action == 'add-vrf'):
        vrf_template = Template(ADD_VRF_TEMPLATE)
        vrf_config = vrf_template.render(vrf_name='{}{}'.format(constants.OVN_EVPN_VRF_PREFIX, evpn_info['vni']), bgp_as=evpn_info['bgp_as'], vni=evpn_info['vni'])
        frr_config_file = 'frr-config-add-vrf-{}'.format(evpn_info['vni'])
    elif (action == 'del-vrf'):
        vrf_template = Template(DEL_VRF_TEMPLATE)
        vrf_config = vrf_template.render(vrf_name='{}{}'.format(constants.OVN_EVPN_VRF_PREFIX, evpn_info['vni']), bgp_as=evpn_info['bgp_as'])
        frr_config_file = 'frr-config-del-vrf-{}'.format(evpn_info['vni'])
    else:
        LOG.error('Unknown FRR reconfiguration action: %s', action)
        return
    with open(frr_config_file, 'w') as vrf_config_file:
        vrf_config_file.write(vrf_config)
    _run_vtysh_config(frr_config_file)