Catch and ignore ImportError on skylab_inventory for unittests.
BUG=chromium:826492
TEST=run unittests without skylab_inventory in site-packages
Change-Id: I4c89052593bc0429dd9bf7a89f70e06e2d64270c
Reviewed-on: https://chromium-review.googlesource.com/1033971
Commit-Ready: Ningning Xia <nxia@chromium.org>
Tested-by: Ningning Xia <nxia@chromium.org>
Reviewed-by: Ningning Xia <nxia@chromium.org>
diff --git a/cli/server.py b/cli/server.py
index f0ab587..213d7e1 100644
--- a/cli/server.py
+++ b/cli/server.py
@@ -34,9 +34,13 @@
from autotest_lib.site_utils import server_manager
from autotest_lib.site_utils import server_manager_utils
from chromite.lib import gob_util
-from skylab_inventory import text_manager
-from skylab_inventory import translation_utils
-from skylab_inventory.lib import server as skylab_server
+
+try:
+ from skylab_inventory import text_manager
+ from skylab_inventory import translation_utils
+ from skylab_inventory.lib import server as skylab_server
+except ImportError:
+ pass
# TODO(nxia): add an option to set logging level.