code: def check_allocate_ip(self, obj, direc):
          
          subnet_lst = self.os_helper.get_all_subnets_cidr(no_mask=True)
          ip_next = obj.allocate_subnet(subnet_lst)
          if ip_next is None:
              LOG.error("Unable to allocate a subnet for direction %s",
                        direc)
          return ip_next
docs: This function allocates a subnet from the pool.
  
          It first checks to see if Openstack is already using the subnet.
          If yes, it retries until it finds a free subnet not used by
          Openstack.