'Pick up unused LDN.'

def _select_ldnumber(self, used_ldns, max_ld_count):

    for ldn in range(0, (max_ld_count + 1)):
        if (ldn not in used_ldns):
            break
    if (ldn > (max_ld_count - 1)):
        msg = _('All    Logical    Disk    Numbers    are    used.    No    more    volumes    can    be    created.')
        raise exception.VolumeBackendAPIException(data=msg)
    return ldn
