platform/dev: add chromite import for internal use in package.
If dev is called as a package, __init__.py can offer a chromite dependency for
it. But __init__.py cannot handle the internal calls.
dev/
__init__.py
A.py
B.py
C.py import package dev, and call functions in A.py, it will succeed.
But if B.py directly calls 'python A.py', or import A to call its funcions, it
will fail.
This CL handles this case.
BUG=chromium:636467
TEST=locally run python cros_update.py, cros_update_progress.py. Run cros
flash.
Change-Id: I69d931b3a20a72a9e33f121f64382004f527cd42
Reviewed-on: https://chromium-review.googlesource.com/375040
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/cros_update.py b/cros_update.py
index 78187c1..6bf3e3f 100644
--- a/cros_update.py
+++ b/cros_update.py
@@ -30,6 +30,8 @@
import os
import sys
+# only import setup_chromite before chromite import.
+import setup_chromite # pylint: disable=unused-import
try:
from chromite.lib import auto_updater
from chromite.lib import remote_access
@@ -38,6 +40,7 @@
logging.debug('chromite cannot be imported: %r', e)
auto_updater = None
remote_access = None
+ timeout_util = None
# Timeout for CrOS auto-update process.
CROS_UPDATE_TIMEOUT_MIN = 30