def alloc_retrieve_subnet_info(self, tenant_id, direc):
serv_obj = self.get_service_obj(tenant_id)<EOL>subnet_dict = self.retrieve_dcnm_subnet_info(tenant_id, direc)<EOL>if subnet_dict:<EOL><INDENT>return subnet_dict<EOL><DEDENT>ip_subnet_dict = self.get_next_ip(tenant_id, direc)<EOL>subnet_dict = self.fill_dcnm_subnet_info(<EOL>tenant_id, ip_subnet_dict.get('<STR_LIT>'),<EOL>ip_subnet_dict.get('<STR_LIT:start>'), ip_subnet_dict.get('<STR_LIT:end>'),<EOL>ip_subnet_dict.get('<STR_LIT>'), ip_subnet_dict.get('<STR_LIT>'),<EOL>direc)<EOL>serv_obj.store_dcnm_subnet_dict(subnet_dict, direc)<EOL>return subnet_dict<EOL>
Allocate and store Subnet.

        This function initially checks if subnet is allocated for a tenant
        for the in/out direction. If not, it calls routine to allocate a subnet
        and stores it on tenant object.