diff options
author | Yunlian Jiang <yunlian@google.com> | 2013-05-29 16:29:51 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-06-03 14:33:16 -0700 |
commit | 9fc991900056e20bb940eed243dad0c0516d497b (patch) | |
tree | 0f357adaccb26c03237180afdd7058d2ea07bba5 /crosperf/machine_manager.py | |
parent | f00adba7fe33c50b1522e6c784de4c4ecd4bf611 (diff) | |
download | toolchain-utils-9fc991900056e20bb940eed243dad0c0516d497b.tar.gz |
crosperf: use mac address as machine id if VPD is not available.
For zgb machine, the dump_vpd_log --full --stdout does not return
serial number, in this case, we use mac address instead.
BUG=None
TEST=It get machine id for zgb
Change-Id: I1058dcd2a18638533c90a40d09adcc7a6bd8a660
Reviewed-on: https://gerrit-int.chromium.org/38900
Reviewed-by: Luis Lozano <llozano@chromium.org>
Tested-by: Yunlian Jiang <yunlian@google.com>
Commit-Queue: Yunlian Jiang <yunlian@google.com>
Diffstat (limited to 'crosperf/machine_manager.py')
-rw-r--r-- | crosperf/machine_manager.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/crosperf/machine_manager.py b/crosperf/machine_manager.py index ea3f17d7..957c8304 100644 --- a/crosperf/machine_manager.py +++ b/crosperf/machine_manager.py @@ -132,8 +132,19 @@ class CrosMachine(object): machine=self.name, chromeos_root=self.chromeos_root) b = if_out.splitlines() a = [l for l in b if "Product" in l] - self.machine_id = a[0] - assert ret == 0, "Could not get machine_id from machine: %s" % self.name + if len(a): + self.machine_id = a[0] + return + command = "ifconfig" + ret, if_out, _ = ce.CrosRunCommand( + command, return_output=True, + machine=self.name, chromeos_root=self.chromeos_root) + b = if_out.splitlines() + a = [l for l in b if "HWaddr" in l] + if len(a): + self.machine_id = "_".join(a) + return + assert 0, "Could not get machine_id from machine: %s" % self.name def __str__(self): l = [] |