aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorStefan Stanacar <stefanx.stanacar@intel.com>2014-02-25 12:46:11 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-25 17:50:46 +0000
commit19af3ac53690b1bd2fee54827090f59c525d2236 (patch)
tree9c7eb8902588ed5b5f905eaccdf032ef5b6323f3 /meta/lib
parent0521d48a1612bfc735e2c86acc9b685c1dc389ef (diff)
downloadopenembedded-core-19af3ac53690b1bd2fee54827090f59c525d2236.tar.gz
oeqa/targetcontrol: properly get the host ip
For the SimpleRemote target where we need the host ip and it wasn't set in conf, we tried to determine it automatically. However ip route output isn't the same for every network, we need the last field from the first line. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/targetcontrol.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
index ba5e6e5dc1..46e5f7fa6b 100644
--- a/meta/lib/oeqa/targetcontrol.py
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -133,7 +133,7 @@ class SimpleRemoteTarget(BaseTarget):
self.server_ip = d.getVar("TEST_SERVER_IP", True)
if not self.server_ip:
try:
- self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split()[6]
+ self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1]
except Exception as e:
bb.fatal("Failed to determine the host IP address (alternatively you can set TEST_SERVER_IP with the IP address of this machine): %s" % e)
bb.note("Server IP: %s" % self.server_ip)