Skip to content

Commit c8290d9

Browse files
committed
wip
1 parent 8f30697 commit c8290d9

File tree

4 files changed

+18
-26
lines changed

4 files changed

+18
-26
lines changed

base/common/python/pki/keyring.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ def put_password(self, key_name, password):
6363

6464
p = subprocess.Popen(cmd,
6565
stdin=subprocess.PIPE,
66-
stdout=subprocess.PIPE,
67-
stderr=subprocess.STDOUT)
66+
stdout=subprocess.PIPE)
6867

6968
return p.communicate(input=password)
7069

base/common/python/pki/nssdb.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ def run(self,
339339

340340
if capture_output:
341341
logger.debug('stdout: %s', stdout)
342+
logger.debug('stderr: %s', stderr)
342343

343344
return result
344345

@@ -549,7 +550,7 @@ def module_exists(self, name):
549550
'-rawlist'
550551
]
551552

552-
result = self.run(cmd, capture_output=True, check=True)
553+
result = self.run(cmd, stdout=subprocess.PIPE, check=True)
553554
output = result.stdout.decode('utf-8')
554555

555556
pattern = re.compile(r' name="%s"' % name)
@@ -641,7 +642,7 @@ def find_keys(self, nickname=None, token=None):
641642
elif logger.isEnabledFor(logging.INFO):
642643
cmd.append('--verbose')
643644

644-
result = self.run(cmd, capture_output=True, check=True, text=True)
645+
result = self.run(cmd, stdout=subprocess.PIPE, check=True, text=True)
645646

646647
return json.loads(result.stdout)
647648

@@ -707,7 +708,7 @@ def create_key(
707708
elif logger.isEnabledFor(logging.INFO):
708709
cmd.append('--verbose')
709710

710-
result = self.run(cmd, capture_output=True, check=True, text=True,
711+
result = self.run(cmd, stdout=subprocess.PIPE, check=True, text=True,
711712
runas=True)
712713

713714
return json.loads(result.stdout)

base/server/python/pki/server/deployment/pkihelper.py

-1
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,6 @@ def execute_using_pki(
878878
return subprocess.run(
879879
command,
880880
stdout=subprocess.PIPE,
881-
stderr=subprocess.PIPE,
882881
check=True,
883882
universal_newlines=True)
884883

base/server/python/pki/server/subsystem.py

+13-20
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,6 @@ def validate_system_cert(self, tag):
461461
subprocess.run(
462462
cmd,
463463
stdout=subprocess.PIPE,
464-
stderr=subprocess.PIPE,
465464
check=True,
466465
universal_newlines=True)
467466

@@ -1297,8 +1296,7 @@ def grant_database_access(
12971296

12981297
self.run(
12991298
cmd,
1300-
as_current_user=as_current_user,
1301-
capture_output=True)
1299+
as_current_user=as_current_user)
13021300

13031301
def revoke_database_access(
13041302
self,
@@ -1318,7 +1316,7 @@ def revoke_database_access(
13181316
self.run(
13191317
cmd,
13201318
as_current_user=as_current_user,
1321-
capture_output=True)
1319+
stdout=subprocess.PIPE)
13221320

13231321
def enable_replication(
13241322
self,
@@ -1861,7 +1859,7 @@ def find_group_members(self, group_id, as_current_user=False):
18611859
result = self.run(
18621860
cmd,
18631861
as_current_user=as_current_user,
1864-
capture_output=True)
1862+
stdout=subprocess.PIPE)
18651863

18661864
return json.loads(result.stdout.decode())
18671865

@@ -1915,7 +1913,7 @@ def find_users(self, see_also=None, as_current_user=False):
19151913
result = self.run(
19161914
cmd,
19171915
as_current_user=as_current_user,
1918-
capture_output=True)
1916+
stdout=subprocess.PIPE)
19191917

19201918
return json.loads(result.stdout.decode())
19211919

@@ -1934,7 +1932,7 @@ def get_user(self, user_id, as_current_user=False):
19341932
result = self.run(
19351933
cmd,
19361934
as_current_user=as_current_user,
1937-
capture_output=True)
1935+
stdout=subprocess.PIPE)
19381936

19391937
return json.loads(result.stdout.decode())
19401938

@@ -2013,8 +2011,7 @@ def add_user(self,
20132011

20142012
self.run(
20152013
cmd,
2016-
as_current_user=as_current_user,
2017-
capture_output=True)
2014+
as_current_user=as_current_user)
20182015

20192016
finally:
20202017
shutil.rmtree(tmpdir)
@@ -2054,8 +2051,7 @@ def modify_user(
20542051

20552052
self.run(
20562053
cmd,
2057-
as_current_user=as_current_user,
2058-
capture_output=True)
2054+
as_current_user=as_current_user)
20592055

20602056
def remove_user(self, user_id, as_current_user=False):
20612057

@@ -2071,8 +2067,7 @@ def remove_user(self, user_id, as_current_user=False):
20712067

20722068
self.run(
20732069
cmd,
2074-
as_current_user=as_current_user,
2075-
capture_output=True)
2070+
as_current_user=as_current_user)
20762071

20772072
def find_user_certs(
20782073
self,
@@ -2124,8 +2119,7 @@ def add_user_cert(self, user_id,
21242119
self.run(
21252120
cmd,
21262121
input=cert_data,
2127-
as_current_user=as_current_user,
2128-
capture_output=True)
2122+
as_current_user=as_current_user)
21292123

21302124
def remove_user_cert(self, user_id, cert_id):
21312125

@@ -2202,6 +2196,8 @@ def remove_user_role(
22022196
def run(self,
22032197
args,
22042198
input=None, # pylint: disable=W0622
2199+
stdout=None,
2200+
stderr=None
22052201
as_current_user=False,
22062202
capture_output=False):
22072203

@@ -2255,9 +2251,6 @@ def run(self,
22552251
if capture_output:
22562252
stdout = subprocess.PIPE
22572253
stderr = subprocess.PIPE
2258-
else:
2259-
stdout = None
2260-
stderr = None
22612254

22622255
try:
22632256
return subprocess.run(
@@ -2434,7 +2427,7 @@ def create_cert(
24342427

24352428
result = self.run(
24362429
cmd,
2437-
capture_output=True)
2430+
stdout=subprocess.PIPE)
24382431

24392432
finally:
24402433
shutil.rmtree(tmpdir)
@@ -2571,7 +2564,7 @@ def import_cert_request(
25712564
result = self.run(
25722565
cmd,
25732566
input=request_data.encode('utf-8'),
2574-
capture_output=True)
2567+
stdout=subprocess.PIPE)
25752568

25762569
return json.loads(result.stdout.decode('utf-8'))
25772570

0 commit comments

Comments
 (0)