andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
Blob Blame History Raw
From 60d570e52465b58167301f64792f5f85cbc85e20 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Wed, 10 Nov 2021 08:53:45 -0500
Subject: [PATCH 11/12] Issue 4978 - use more portable python command for
 checking containers

Description:  During the installation check for containers use arguments
              for subprocess.run() that work on all versions of python

relates: https://github.com/389ds/389-ds-base/issues/4978

Reviewed by: mreynolds(one line commit rule)
---
 src/lib389/lib389/instance/setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib389/lib389/instance/setup.py b/src/lib389/lib389/instance/setup.py
index 7b0147cf9..b23d2deb8 100644
--- a/src/lib389/lib389/instance/setup.py
+++ b/src/lib389/lib389/instance/setup.py
@@ -734,7 +734,7 @@ class SetupDs(object):
         # Check if we are in a container, if so don't use /dev/shm for the db home dir
         # as containers typically don't allocate enough space for dev/shm and we don't
         # want to unexpectedly break the server after an upgrade
-        container_result = subprocess.run(["systemd-detect-virt", "-c"], capture_output=True)
+        container_result = subprocess.run(["systemd-detect-virt", "-c"], stdout=subprocess.PIPE)
         if container_result.returncode == 0:
             # In a container, set the db_home_dir to the db path
             self.log.debug("Container detected setting db home directory to db directory.")
-- 
2.31.1