From: Richard Purdie Date: Wed, 29 Jul 2015 09:50:49 +0000 (+0100) Subject: sshcontrol: Use os.environ.copy() instead of copy.copy() X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~29555 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=638cd44cc9a9eb435350aac7e8eeec585d74f8db;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git sshcontrol: Use os.environ.copy() instead of copy.copy() os.environ is special and copy.copy() doesn't do what we'd expect, changes in the child object change the parent. copy.deepcopy() is also known to have issues with it. Use the dedicated .copy() method which will not influence the parent. This fixes selftest failures where the DISPLAY variable disappears. Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py index 4f8d3d2c98f..6ed48badc89 100644 --- a/meta/lib/oeqa/utils/sshcontrol.py +++ b/meta/lib/oeqa/utils/sshcontrol.py @@ -10,7 +10,6 @@ import subprocess import time import os import select -import copy class SSHProcess(object): @@ -33,7 +32,7 @@ class SSHProcess(object): self.logfile = None # Unset DISPLAY which means we won't trigger SSH_ASKPASS - env = copy.copy(os.environ) + env = os.environ.copy() if "DISPLAY" in env: del env['DISPLAY'] self.options['env'] = env