From patchwork Wed Apr 10 21:38:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Terry Wilson X-Patchwork-Id: 1922239 X-Patchwork-Delegate: i.maximets@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=I6vJuoto; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VFGSG6xKrz1yYB for ; Thu, 11 Apr 2024 07:39:26 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id CE9C84027A; Wed, 10 Apr 2024 21:39:24 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id wy74yYOhwK0J; Wed, 10 Apr 2024 21:39:23 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B8CE441506 Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=I6vJuoto Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id B8CE441506; Wed, 10 Apr 2024 21:39:23 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8F480C0077; Wed, 10 Apr 2024 21:39:23 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id C71DCC0DD2 for ; Wed, 10 Apr 2024 21:39:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B5A6440917 for ; Wed, 10 Apr 2024 21:39:22 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id rfAYXV7qwprX for ; Wed, 10 Apr 2024 21:39:22 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=twilson@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org B565C40491 Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org B565C40491 Authentication-Results: smtp2.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=I6vJuoto Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id B565C40491 for ; Wed, 10 Apr 2024 21:39:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712785160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0bBJGGLEF6W/TcPEI6/rP9TbE1JkN9KMr1YVBYDSMu8=; b=I6vJuotoYIvqHfUP2n02GeG7icokL3luhMQa7PchtGxlLKKKEP3q8wPciJn4Op7jYqy+6m YCgf3KPstzcvJV7kDlBIrvW410ATqBf6/bVzCx1K+MfoVWblGoUIei/gy1xR4RV+zKk/ZO +o2oC1FSscsqGb77lF3OisBHIXo/LgU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-279-Or1zzO0gNWSPIbkJgYwywg-1; Wed, 10 Apr 2024 17:39:19 -0400 X-MC-Unique: Or1zzO0gNWSPIbkJgYwywg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1A6B9800198 for ; Wed, 10 Apr 2024 21:39:19 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.33.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id E303A492BC6; Wed, 10 Apr 2024 21:39:18 +0000 (UTC) From: Terry Wilson To: dev@openvswitch.org Date: Wed, 10 Apr 2024 16:38:26 -0500 Message-Id: <20240410213826.3126397-3-twilson@redhat.com> In-Reply-To: <20240410213826.3126397-1-twilson@redhat.com> References: <20240410213826.3126397-1-twilson@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH 3/3] python: ovsdb-idl: Convert new_uuid insert() arg to UUID. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The argument to insert() should be a uuid.UUID object. If it isn't then a Row is created with a string uuid attribute and that row is added to table.rows with a string key instead of a UUID key. Fixes: 55b9507e6824 ("ovsdb-idl: Add the support to specify the uuid for row insert.") Signed-off-by: Terry Wilson --- python/ovs/db/idl.py | 2 +- tests/test-ovsdb.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index a80da84e7..0e201366b 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -1854,7 +1854,7 @@ class Transaction(object): if row._data is None: op["op"] = "insert" if row._persist_uuid: - op["uuid"] = row.uuid + op["uuid"] = str(row.uuid) else: op["uuid-name"] = _uuid_name_from_uuid(row.uuid) diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py index 48f8ee2d7..6307aa2bd 100644 --- a/tests/test-ovsdb.py +++ b/tests/test-ovsdb.py @@ -434,7 +434,7 @@ def idl_set(idl, commands, step): sys.stderr.write('"set" command requires 2 argument\n') sys.exit(1) - s = txn.insert(idl.tables["simple"], new_uuid=args[0], + s = txn.insert(idl.tables["simple"], new_uuid=uuid.UUID(args[0]), persist_uuid=True) s.i = int(args[1]) elif name == "delete":