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
            )
        )
A DRY helper function for yearly repeat tests.
dataset/ETHPy150Open openstack/compass-core/compass/db/api/network.py/_check_subnet_deletable--crossover with--dataset/ETHPy150Open wreckage/django-happenings/tests/integration_tests/test_repeat.py/RepeatingEventListViewTest.check_dates_yearly