'Ensure that no internal network interface is attached
to the router.'

def _ensure_router_not_in_use(self, context, router_id):

    router = self._get_router(context, router_id)
    device_owner = self._get_device_owner(context, router)
    if any(((rp.port_type == device_owner) for rp in router.attached_ports.all())):
        raise l3.RouterInUse(router_id=router_id)
    return router
