Deal with missing chromite in retry module

The chromite module only exists in chroot. Need to handle the exception
of missing chromite when the retry module is run on non-chroot environment,
for example on DUT.

BUG=chromium:496989
TEST=run display_Resolution.extended with multimedia XMLRPC server being
successfully brought up on DUT.

Change-Id: Ia7e2d12eb4f786317c45ddefe633a86bf632e96c
Reviewed-on: https://chromium-review.googlesource.com/275413
Reviewed-by: Yuli Huang <yuli@chromium.org>
Commit-Queue: Hung-ying Tyan <tyanh@chromium.org>
Tested-by: Hung-ying Tyan <tyanh@chromium.org>
diff --git a/client/common_lib/cros/retry.py b/client/common_lib/cros/retry.py
index dc5cb25..380ea92 100644
--- a/client/common_lib/cros/retry.py
+++ b/client/common_lib/cros/retry.py
@@ -4,10 +4,14 @@
 
 import logging, math, random, signal, sys, time
 
-from chromite.lib import retry_util
-
 from autotest_lib.client.common_lib import error
 
+try:
+    from chromite.lib import retry_util
+except ImportError:
+    logging.warn('Unable to import chromite for retry_util.')
+    retry_util = None
+
 
 def handler(signum, frame):
     """
@@ -254,6 +258,9 @@
             kwargs['sleep'] = sleep
             kwargs['backoff_factor'] = backoff
 
+            if retry_util is None:
+                logging.warn('Failed to decorate with retry_exponential.')
+                return func
             return retry_util.GenericRetry(handler, max_retry, func,
                                             *args, **kwargs)