def _check_subnet_deletable(subnet):
    if subnet.host_networks:
        host_networks = [
            '%s:%s=%s' % (
                host_network.host.name, host_network.interface,
                host_network.ip
            )
            for host_network in subnet.host_networks
        ]
        raise exception.NotAcceptable(
            'subnet %s contains host networks %s' % (
                subnet.subnet, host_networks
            )
        )
Check a subnet deletable.
dataset/ETHPy150Open openstack/compass-core/compass/db/api/network.py/_check_subnet_deletable