Skip to content

Commit

Permalink
ovs-monitor-ipsec: Fix _nss_clear_database() parse error.
Browse files Browse the repository at this point in the history
_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 <mark.d.gray@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
  • Loading branch information
markdgray authored and igsilya committed Jan 5, 2021
1 parent a3c318a commit 9505f78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ipsec/ovs-monitor-ipsec.in
Expand Up @@ -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,
universal_newlines=True)
lines = proc.stdout.readlines()

for line in lines:
Expand Down

0 comments on commit 9505f78

Please sign in to comment.