def _delete_os_nwk(self, tenant_id, tenant_name, direc, is_fw_virt=False):
serv_obj = self.get_service_obj(tenant_id)<EOL>fw_dict = serv_obj.get_fw_dict()<EOL>fw_id = fw_dict.get('<STR_LIT>')<EOL>fw_data, fw_data_dict = self.get_fw(fw_id)<EOL>if fw_data is None:<EOL><INDENT>LOG.error("<STR_LIT>", tenant_name)<EOL>return False<EOL><DEDENT>if direc == '<STR_LIT>':<EOL><INDENT>net_id = fw_data.in_network_id<EOL>seg, vlan = self.get_in_seg_vlan(tenant_id)<EOL>subnet_dict = self.get_in_ip_addr(tenant_id)<EOL><DEDENT>else:<EOL><INDENT>net_id = fw_data.out_network_id<EOL>seg, vlan = self.get_out_seg_vlan(tenant_id)<EOL>subnet_dict = self.get_out_ip_addr(tenant_id)<EOL><DEDENT>sub = subnet_dict.get('<STR_LIT>')<EOL>try:<EOL><INDENT>ret = self.os_helper.delete_network_all_subnets(net_id)<EOL>if not ret:<EOL><INDENT>LOG.error("<STR_LIT>"<EOL>"<STR_LIT>", {'<STR_LIT>': net_id, '<STR_LIT>': direc})<EOL>return False<EOL><DEDENT><DEDENT>except Exception as exc:<EOL><INDENT>LOG.error("<STR_LIT>"<EOL>"<STR_LIT>",<EOL>{'<STR_LIT>': net_id, '<STR_LIT>': direc, '<STR_LIT>': exc})<EOL>return False<EOL><DEDENT>if not is_fw_virt:<EOL><INDENT>self.service_vlans.release_segmentation_id(vlan)<EOL><DEDENT>self.service_segs.release_segmentation_id(seg)<EOL>self.release_subnet(sub, direc)<EOL>self.delete_network_db(net_id)<EOL>return True<EOL>
Delete the network created in Openstack.

        Function to delete Openstack network, It also releases the associated
        segmentation, VLAN and subnets.