summaryrefslogtreecommitdiffstats
path: root/meta/lib
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:29 +0000
commite4893d48300ea6a3e172e046f83f3d4c54e95786 (patch)
tree6f92b9867834d02ebc1a1af143ab4e9d0ff8dc38 /meta/lib
parent3161eecefcbd0eb4373520f9719353fec5fada93 (diff)
downloadpoky-e4893d48300ea6a3e172e046f83f3d4c54e95786.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. (From OE-Core rev: c3bd502f31a621394a2f6ea3ae90443ff4ac98a4) Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-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
97 if self.powercontrol_cmd: 97 if self.powercontrol_cmd:
98 cmd = "%s %s" % (self.powercontrol_cmd, msg) 98 cmd = "%s %s" % (self.powercontrol_cmd, msg)
99 try: 99 try:
100 commands.runCmd(cmd, assert_error=False, preexec_fn=os.setsid, env=self.origenv) 100 commands.runCmd(cmd, assert_error=False, start_new_session=True, env=self.origenv)
101 except CommandError as e: 101 except CommandError as e:
102 bb.fatal(str(e)) 102 bb.fatal(str(e))
103 103
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):
247 "stdin": None, 247 "stdin": None,
248 "shell": False, 248 "shell": False,
249 "bufsize": -1, 249 "bufsize": -1,
250 "preexec_fn": os.setsid, 250 "start_new_session": True,
251 } 251 }
252 options.update(opts) 252 options.update(opts)
253 output = '' 253 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):
23 "stdin": None, 23 "stdin": None,
24 "shell": False, 24 "shell": False,
25 "bufsize": -1, 25 "bufsize": -1,
26 "preexec_fn": os.setsid, 26 "start_new_session": True,
27 } 27 }
28 self.options = dict(self.defaultopts) 28 self.options = dict(self.defaultopts)
29 self.options.update(options) 29 self.options.update(options)