common_util: Fix IsRunningOnMoblab function to work with nextgen
New moblab use -moblab postfix, old moblabs used _moblab
Allow this code to work with both
TEST=Tested on moblab
BUG=chromium:814949
Change-Id: Id520d7a00597a4d514cc48c1cbf9d290f15843c0
Reviewed-on: https://chromium-review.googlesource.com/1067880
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Keith Haddow <haddowk@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
diff --git a/common_util.py b/common_util.py
index a606d9d..150881b 100644
--- a/common_util.py
+++ b/common_util.py
@@ -14,6 +14,7 @@
import errno
import hashlib
import os
+import re
import shutil
import tempfile
import threading
@@ -429,7 +430,7 @@
cmd_error.rstrip())
return False
- if '_moblab' in cmd_output:
+ if re.search("r[_-]+moblab", cmd_output):
return True
else:
return False