def _get_segmentation_id(self, segid):

        try:
            newseg = (segid, self.segmentation_pool.remove(segid)
                      if segid and segid in self.segmentation_pool else
                      self.segmentation_pool.pop())
            return newseg[0] if newseg[0] else newseg[1]
        except KeyError:
            LOG.exception(_LE('Error: Segmentation id pool is empty'))
            return 0
Allocate segmentation id.
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/apps/saf/server/dfa_server.py/DfaServer._get_segmentation_id