'Check if a default already exists for the given IP version.
There can only be one default subnetpool for each IP family. Raise an
InvalidInput error if a default has already been set.'

def _check_default_subnetpool_exists(self, context, ip_version):

    if self.get_default_subnetpool(context, ip_version):
        msg = _('A    default    subnetpool    for    this    IP    family    has    already    been    set.    Only    one    default    may    exist    per    IP    family')
        raise exc.InvalidInput(error_message=msg)
