Update prerequisite error message to use it for plx alerts
BUG=b:131440102
TEST=None
Change-Id: Iaa71969846c5c52d25c631dd4f96282a4fc70d7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2023867
Tested-by: Rohit Makasana <rohitbm@chromium.org>
Commit-Queue: Rohit Makasana <rohitbm@chromium.org>
Reviewed-by: Kazuhiro Inaba <kinaba@chromium.org>
Reviewed-by: Rohit Makasana <rohitbm@chromium.org>
Reviewed-by: Ian Lee <ianrlee@google.com>
Auto-Submit: Rohit Makasana <rohitbm@chromium.org>
diff --git a/server/cros/tradefed/tradefed_prerequisite.py b/server/cros/tradefed/tradefed_prerequisite.py
index 07524dc..0da8c66 100644
--- a/server/cros/tradefed/tradefed_prerequisite.py
+++ b/server/cros/tradefed/tradefed_prerequisite.py
@@ -4,17 +4,19 @@
import logging
+_ERROR_PREFIX = 'CTS Test Precondition Failed'
+
def bluetooth(hosts):
"""Check for missing bluetooth hardware.
"""
# TODO(ianrlee): Reenable, once a nice check is found in b/148621587.
- #for host in hosts:
+ # for host in hosts:
# output = host.run('hcitool dev').stdout
# lines = output.splitlines()
# if len(lines) < 2 or not lines[0].startswith('Devices:'):
- # return False, 'Failed: Bluetooth device is missing.'\
+ # return False, '%s: Bluetooth device is missing.'\
# 'Stdout of the command "hcitool dev1"'\
- # 'on host %s was %s' % (host, output)
+ # 'on host %s was %s' % (_ERROR_PREFIX, host, output)
return True, ''
@@ -24,10 +26,10 @@
for host in hosts:
output = host.run('vpd -g region').stdout
if output != 'us':
- return False, 'Failed: Region is not "us".'\
+ return False, '%s: Region is not "us".'\
'Stdout of the command "vpd -l'\
'| grep region" on host %s was %s'\
- % (host, output)
+ % (_ERROR_PREFIX, host, output)
return True, ''
prerequisite_map = {