From 90f3642c11657d9b428e9f0d8e2718ff987efd7f Mon Sep 17 00:00:00 2001 From: Viktor Ashirov Date: Apr 03 2020 13:02:42 +0000 Subject: Issue 50952 - SSCA lacks basicConstraint:CA Bug Description: `capture_output` was introduced in python 3.7 and on earlier versions this code produces TypeError. Fix Description: Make it compatible with python 3.6 by setting `stderr` and `stdout` to PIPE. Fixes: https://pagure.io/389-ds-base/issue/50952 Reviewed by: mhonek (Thanks!) --- diff --git a/src/lib389/lib389/nss_ssl.py b/src/lib389/lib389/nss_ssl.py index a772c5e..8d0a5a4 100644 --- a/src/lib389/lib389/nss_ssl.py +++ b/src/lib389/lib389/nss_ssl.py @@ -19,7 +19,7 @@ import logging # from nss import nss import subprocess from datetime import datetime, timedelta, date -from subprocess import check_output, run +from subprocess import check_output, run, PIPE from lib389.passwd import password_generate from lib389.lint import DSCERTLE0001, DSCERTLE0002 from lib389.utils import ensure_str, format_cmd_list @@ -254,7 +254,7 @@ only. ] cmd_input = b'y\n\n' # responses to certutil questions self.log.debug("nss cmd: %s", format_cmd_list(cmd)) - result = ensure_str(run(cmd, check=True, capture_output=True, input=cmd_input).stdout) + result = ensure_str(run(cmd, check=True, stderr=PIPE, stdout=PIPE, input=cmd_input).stdout) self.log.debug("nss output: %s", result) # Now extract the CAcert to a well know place. # This allows us to point the cacert dir here and it "just works"