def createVPNPayload(service_name, source_target, dest_target):

    intps = {
        'service_id'    : service_name,
        'service_name'  : service_name,
        'router_a'      : source_target.router,
        'interface_a'   : source_target.interface,
        'router_b'      : dest_target.router,
        'interface_b'   : dest_target.interface
    }

    if source_target.vlan and dest_target.vlan:
        #assert source_target.vlan == dest_target.vlan, 'VLANs must match (until we get rewrite in place)'
        if source_target.vlan == dest_target.vlan:
            intps['vlan'] = source_target.vlan
            payload = ETHERNET_VLAN_VPN_PAYLOAD_BASE % intps
        else:
            intps['vlan_a'] = source_target.vlan
            intps['vlan_b'] = dest_target.vlan
            payload = ETHERNET_VLAN_REWRITE_VPN_PAYLOAD_BASE % intps
    else:
        payload = intps % ETHERNET_VPN_PAYLOAD_BASE

    return payload
dataset/ETHPy150Open NORDUnet/opennsa/opennsa/backends/ncsvpn.py/createVPNPayload/swapped operands of `%`