mirror of
https://git.yoctoproject.org/poky
synced 2026-02-20 08:29:42 +01:00
oeqa: modernise subprocess: preexec_fn=os.setsid -> start_new_session=True
start_new_session was added to python3 subprocess in v3.2 and is meant to take the place of the common use of preexec_fn to call os.setsid() in the child - as done here. Update to use the new equivalent. (From OE-Core rev: c3bd502f31a621394a2f6ea3ae90443ff4ac98a4) Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
3161eecefc
commit
e4893d4830
@@ -97,7 +97,7 @@ class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget, metaclass=ABCMeta
|
||||
if self.powercontrol_cmd:
|
||||
cmd = "%s %s" % (self.powercontrol_cmd, msg)
|
||||
try:
|
||||
commands.runCmd(cmd, assert_error=False, preexec_fn=os.setsid, env=self.origenv)
|
||||
commands.runCmd(cmd, assert_error=False, start_new_session=True, env=self.origenv)
|
||||
except CommandError as e:
|
||||
bb.fatal(str(e))
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ def SSHCall(command, logger, timeout=None, **opts):
|
||||
"stdin": None,
|
||||
"shell": False,
|
||||
"bufsize": -1,
|
||||
"preexec_fn": os.setsid,
|
||||
"start_new_session": True,
|
||||
}
|
||||
options.update(opts)
|
||||
output = ''
|
||||
|
||||
@@ -23,7 +23,7 @@ class SSHProcess(object):
|
||||
"stdin": None,
|
||||
"shell": False,
|
||||
"bufsize": -1,
|
||||
"preexec_fn": os.setsid,
|
||||
"start_new_session": True,
|
||||
}
|
||||
self.options = dict(self.defaultopts)
|
||||
self.options.update(options)
|
||||
|
||||
Reference in New Issue
Block a user