summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Draszik <git@andred.net>2020-02-03 17:28:12 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-04 15:56:24 +0000
commitc3bd502f31a621394a2f6ea3ae90443ff4ac98a4 (patch)
tree7e29a17e1a3ffef972895311cd7803ae4d6911e0
parent9cc4dc9cc951157e6e374192c88369432ae5cff1 (diff)
downloadopenembedded-core-contrib-c3bd502f31a621394a2f6ea3ae90443ff4ac98a4.tar.gz
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. Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/controllers/masterimage.py2
-rw-r--r--meta/lib/oeqa/core/target/ssh.py2
-rw-r--r--meta/lib/oeqa/utils/sshcontrol.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/meta/lib/oeqa/controllers/masterimage.py b/meta/lib/oeqa/controllers/masterimage.py
index 0435dfa125..0bf5917e48 100644
--- a/meta/lib/oeqa/controllers/masterimage.py
+++ b/meta/lib/oeqa/controllers/masterimage.py
@@ -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))
diff --git a/meta/lib/oeqa/core/target/ssh.py b/meta/lib/oeqa/core/target/ssh.py
index 63fc9468b3..090b40a814 100644
--- a/meta/lib/oeqa/core/target/ssh.py
+++ b/meta/lib/oeqa/core/target/ssh.py
@@ -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 = ''
diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py
index 49a07264c6..36c2ecb3db 100644
--- a/meta/lib/oeqa/utils/sshcontrol.py
+++ b/meta/lib/oeqa/utils/sshcontrol.py
@@ -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)