Use cros_logging instead of cros_build_lib.Info
Replace all instances of cros_build_lib.Info with cros_logging.info
in crostestutils.
BUG=brillo:600
TEST=trybot
Change-Id: Ie0b1c909eaf32412b159f0579ac9fd0417966332
Reviewed-on: https://chromium-review.googlesource.com/261971
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Ralph Nathan <ralphnathan@chromium.org>
Trybot-Ready: Ralph Nathan <ralphnathan@chromium.org>
Tested-by: Ralph Nathan <ralphnathan@chromium.org>
diff --git a/au_test_harness/au_test.py b/au_test_harness/au_test.py
index abe83fc..527f9cc 100644
--- a/au_test_harness/au_test.py
+++ b/au_test_harness/au_test.py
@@ -11,6 +11,7 @@
import urllib
from chromite.lib import cros_build_lib
+from chromite.lib import cros_logging as logging
from chromite.lib import dev_server_wrapper
from crostestutils.au_test_harness import cros_test_proxy
from crostestutils.au_test_harness import real_au_worker
@@ -175,7 +176,7 @@
signed_target_image_path,
private_key_path=self.private_key)
else:
- cros_build_lib.Info('No key found to use for signed testing.')
+ logging.info('No key found to use for signed testing.')
def SimpleTestUpdateAndVerify(self):
"""Test that updates to itself.
diff --git a/au_test_harness/au_worker.py b/au_test_harness/au_worker.py
index 7b2c3c6..4d260dc 100644
--- a/au_test_harness/au_worker.py
+++ b/au_test_harness/au_worker.py
@@ -13,6 +13,7 @@
import os
from chromite.lib import cros_build_lib
+from chromite.lib import cros_logging as logging
from chromite.lib import dev_server_wrapper
from crostestutils.au_test_harness import update_exception
@@ -239,7 +240,7 @@
return percent_passed
def TestInfo(self, message):
- cros_build_lib.Info('%s: %s', self.test_name, message)
+ logging.info('%s: %s', self.test_name, message)
def Initialize(self, port):
"""Initializes test specific variables for each test.
diff --git a/au_test_harness/cros_au_test_harness.py b/au_test_harness/cros_au_test_harness.py
index 9c2f349..dd98d7e 100755
--- a/au_test_harness/cros_au_test_harness.py
+++ b/au_test_harness/cros_au_test_harness.py
@@ -26,6 +26,7 @@
sys.path.append(constants.SOURCE_ROOT)
from chromite.lib import cros_build_lib
+from chromite.lib import cros_logging as logging
from chromite.lib import dev_server_wrapper
from chromite.lib import parallel
from chromite.lib import sudo
@@ -80,7 +81,7 @@
cache_file = os.path.join(path_to_dump, CACHE_FILE)
if os.path.exists(cache_file):
- cros_build_lib.Info('Loading update cache from ' + cache_file)
+ logging.info('Loading update cache from ' + cache_file)
with open(cache_file) as file_handle:
return pickle.load(file_handle)
@@ -104,7 +105,7 @@
test_case = unittest.TestLoader().loadTestsFromName(test_name)
steps.append(functools.partial(_LessBacktracingTestRunner().run, test_case))
- cros_build_lib.Info('Running tests in test suite in parallel.')
+ logging.info('Running tests in test suite in parallel.')
try:
parallel.RunParallelSteps(steps, max_parallel=options.jobs)
except parallel.BackgroundFailure as ex:
@@ -127,7 +128,7 @@
parser.error('Testing requires a valid target image.')
if not options.base_image:
- cros_build_lib.Info('No base image supplied. Using target as base image.')
+ logging.info('No base image supplied. Using target as base image.')
options.base_image = options.target_image
if not os.path.isfile(options.base_image):
@@ -200,7 +201,7 @@
if not update_cache:
msg = ('No update cache found. Update testing will not work. Run '
' cros_generate_update_payloads if this was not intended.')
- cros_build_lib.Info(msg)
+ logging.info(msg)
# Create download folder for payloads for testing.
download_folder = os.path.join(os.path.realpath(os.path.curdir),
diff --git a/lib/public_key_manager.py b/lib/public_key_manager.py
index 95c4886..095d499 100644
--- a/lib/public_key_manager.py
+++ b/lib/public_key_manager.py
@@ -9,6 +9,7 @@
import constants
from chromite.lib import cros_build_lib
+from chromite.lib import cros_logging as logging
from chromite.lib import git
from chromite.lib import osutils
from crostestutils.lib import mount_helper
@@ -49,11 +50,11 @@
def AddKeyToImage(self):
"""Adds the key specified in init to the image."""
if not self._is_key_new:
- cros_build_lib.Info('Public key already on image %s. No work to do.',
- self.image_path)
+ logging.info('Public key already on image %s. No work to do.',
+ self.image_path)
return
- cros_build_lib.Info('Copying %s into %s', self.key_path, self.image_path)
+ logging.info('Copying %s into %s', self.key_path, self.image_path)
try:
mount_helper.MountImage(self.image_path, self._rootfs_dir,
self._stateful_dir, read_only=False)
diff --git a/utils_py/cros_run_parallel_vm_tests.py b/utils_py/cros_run_parallel_vm_tests.py
index f972e54..f7a067b 100755
--- a/utils_py/cros_run_parallel_vm_tests.py
+++ b/utils_py/cros_run_parallel_vm_tests.py
@@ -14,6 +14,7 @@
import constants
sys.path.append(constants.SOURCE_ROOT)
from chromite.lib import cros_build_lib
+from chromite.lib import cros_logging as logging
_DEFAULT_BASE_SSH_PORT = 9322
@@ -89,11 +90,11 @@
if self._quiet:
args.append('--verbose=0') # generate less output
output = open('/dev/null', mode='w')
- cros_build_lib.Info('Log files are in %s', results_dir)
+ logging.info('Log files are in %s', results_dir)
elif self._order_output:
output = tempfile.NamedTemporaryFile(prefix='parallel_vm_test_')
- cros_build_lib.Info('Piping output to %s.', output.name)
- cros_build_lib.Info('Running %r...', args)
+ logging.info('Piping output to %s.', output.name)
+ logging.info('Running %r...', args)
proc = subprocess.Popen(args, stdout=output, stderr=output)
test_info = { 'test': test,
'proc': proc,
@@ -121,11 +122,11 @@
output = test_info['output']
if output and not self._quiet:
test = test_info['test']
- cros_build_lib.Info('------ START %s:%s ------', test, output.name)
+ logging.info('------ START %s:%s ------', test, output.name)
output.seek(0)
for line in output:
print line,
- cros_build_lib.Info('------ END %s:%s ------', test, output.name)
+ logging.info('------ END %s:%s ------', test, output.name)
return failed_tests
def Run(self):