def _validate_shared_net_resource(action, body=None):
    """Validate keys in outgoing shared network request"""
    if body:
        body_set = set(body.keys())
    else:
        return
    if 'vm-network' in action and 'port' not in action:
        vmnetwork_set = set(_resource_metadata['vmnetwork'])
        if body_set - vmnetwork_set:
            raise c_exc.VSMError(reason='Invalid Request')
    elif 'port' in action:
        port_set = set(_resource_metadata['port'])
        if body_set - port_set:
            raise c_exc.VSMError(reason='Invalid Request')
    elif 'subnet' in action:
        subnet_set = set(_resource_metadata['subnet'])
        if subnet_set - body_set:
            raise c_exc.VSMError(reason='Invalid Request')
    elif '/network-segment/' in action:
        network_set = set(_resource_metadata['network-segment'])
        if body_set - network_set:
            raise c_exc.VSMError(reason='Invalid Request')
        if body['tenantId'] != '0':
            raise c_exc.VSMError(reason='Invalid Shared Network Handling')
    else:
        return
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/tests/unit/ml2/drivers/cisco/n1kv/fake_client.py/_validate_shared_net_resource/swapped operands of `-`