2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 05:55:28 +00:00

[#3287] address review

This commit is contained in:
Andrei Pavel
2024-06-17 18:26:05 +03:00
parent 9c35a4db68
commit 3791bb03b0
2 changed files with 8 additions and 10 deletions

View File

@@ -384,9 +384,9 @@ def execute(cmd, timeout=60, cwd=None, env=None, raise_error=True, dry_run=False
# security issue.
with subprocess.Popen(cmd, cwd=cwd, env=env, shell=True, # nosec: B602
stdout=subprocess.PIPE, stderr=subprocess.STDOUT) as pipe:
if timeout is not None:
pipe.wait(timeout)
try:
if timeout is not None:
pipe.wait(timeout)
stdout, _ = pipe.communicate()
except subprocess.TimeoutExpired as e:
pipe.kill()