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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user