def check_allocate_ip(self, obj, direc):
subnet_lst = self.os_helper.get_all_subnets_cidr(no_mask=True)<EOL>ip_next = obj.allocate_subnet(subnet_lst)<EOL>if ip_next is None:<EOL><INDENT>LOG.error("<STR_LIT>",<EOL>direc)<EOL><DEDENT>return ip_next<EOL>
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.