From patchwork Wed Dec 23 13:58:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Gray X-Patchwork-Id: 1420138 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: 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=KjnPzbU9; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D1FDc3C29z9sVY for ; Thu, 24 Dec 2020 00:58:55 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 95D5986669; Wed, 23 Dec 2020 13:58:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OsF4r+4ztBYo; Wed, 23 Dec 2020 13:58:50 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 642288634E; Wed, 23 Dec 2020 13:58:50 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 441B4C1825; Wed, 23 Dec 2020 13:58:50 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id AB5C8C0893 for ; Wed, 23 Dec 2020 13:58:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id A6C658598E for ; Wed, 23 Dec 2020 13:58:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id alBxwmDNqthM for ; Wed, 23 Dec 2020 13:58:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by fraxinus.osuosl.org (Postfix) with ESMTPS id A52A1858FB for ; Wed, 23 Dec 2020 13:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608731924; 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; bh=rASuM5L86os6rf91NppxI9qQJnsN9zdJSzuF5adQIZE=; b=KjnPzbU9HudEpWb56AIcS9KCAxN2dRAS53C0Hkj8HYbwIZq8rIVQi+DD0YsEWXoE7ANSnL DEzwmwuFfCbRTOSaBqL7KhmoU2TOTcvFalMqpJXH3c6XOaaE5hvp4juS8pjlN2mBUaLJGX TrVG/AfupkjedeqWgcsJaq10yS7wXQs= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-448-5pl7tNHTO6eqK3qwnfeWVg-1; Wed, 23 Dec 2020 08:58:42 -0500 X-MC-Unique: 5pl7tNHTO6eqK3qwnfeWVg-1 Received: by mail-wr1-f72.google.com with SMTP id g16so12732441wrv.1 for ; Wed, 23 Dec 2020 05:58:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rASuM5L86os6rf91NppxI9qQJnsN9zdJSzuF5adQIZE=; b=NshbEWG/KNJW26M/hDgcAXNnQhmPq+pTyaTTH9ehmhxRT7aevt4TMeGp2nTM8pbTHa WqzH9GsQ2oJOkcTBKJ2GKEEigs4ck6WTPyCIg3b0LN9onlTbh5kDO2qDG/9w/OjNaTqY bN457aQElvJBfyS7LO8wm3mrC2kneprAPL2Kd4pnoAqKnFnmrniiidAjCQ0pCVsT7SoY DnX4wWSqgaDchSnfXfE1vT8/qOhTJc05eOFwML2Dck9K0gYAzNzTHsoORpcbeuqSAI7S 9+cBRGU8gYwwCiNT0TgC7CjfCKqZbfPu3upLxPNYuZ1E11kpvR1lrobyNnos595XTydn PZuw== X-Gm-Message-State: AOAM532dYcsk+NokVRN+DVeSln8vep6a6ETGEnaGlNXnxRdeXmfAefN0 PhYmBCtko7IcVxYdUGq/7Nk2kPqMQVJ8pkJ8u5BGQ4363T5pa7U2tK+sKR2MJLzNUD4a/82E/nM RJruAfRK4Y0KIBkzp+TBOpO5sqpgeTI78jA4WxQitroKGcjtuOEb2W6C2m8om+qwpkGOc X-Received: by 2002:adf:f6cc:: with SMTP id y12mr29381983wrp.35.1608731920905; Wed, 23 Dec 2020 05:58:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJXsR+ectYy7J21UpuR/QR3I1f7dfiacH/MsWKMwi3rc6pxaqOSQi22i4O3dboVXGrBePcEQ== X-Received: by 2002:adf:f6cc:: with SMTP id y12mr29381963wrp.35.1608731920673; Wed, 23 Dec 2020 05:58:40 -0800 (PST) Received: from wsfd-netdev77.ntdv.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id n11sm18071701wra.9.2020.12.23.05.58.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Dec 2020 05:58:39 -0800 (PST) From: Mark Gray To: dev@openvswitch.org Date: Wed, 23 Dec 2020 08:58:37 -0500 Message-Id: <20201223135837.686676-1-mark.d.gray@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mark.d.gray@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH] ovs-monitor-ipsec: Fix _nss_clear_database() parse error 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" _nss_clear_database() runs `certutil` in order to get a list of certificates currently loaded in NSS. This fails with error: "ovs-monitor-ipsec | ERR | Failed to clear NSS database. startswith first arg must be bytes or a tuple of bytes, not str" Modify subprocess.Popen() to write in 'text' mode so that 'startwith' can correctly parse output. Signed-off-by: Mark Gray --- ipsec/ovs-monitor-ipsec.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipsec/ovs-monitor-ipsec.in b/ipsec/ovs-monitor-ipsec.in index b84608a55d8a..903e6bc4aaf0 100755 --- a/ipsec/ovs-monitor-ipsec.in +++ b/ipsec/ovs-monitor-ipsec.in @@ -657,7 +657,8 @@ conn prevent_unencrypted_vxlan proc = subprocess.Popen(['certutil', '-L', '-d', 'sql:/etc/ipsec.d/'], stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + stderr=subprocess.PIPE, + text=True) lines = proc.stdout.readlines() for line in lines: