[autotest] Delete devserver retry loop in machine_install().
In CrosHost.machine_install(), there's a loop to retry certain
provisioning failures. The loop is broken: Handling for retries
will fail in most cases because it depends on a local variable that
normally is never set.
BUG=None
TEST=None
Change-Id: Id3f276ee54d6d63dac4a3b6724321a4831714d8a
Reviewed-on: https://chromium-review.googlesource.com/1024449
Commit-Ready: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Keith Haddow <haddowk@chromium.org>
Reviewed-by: Congbin Guo <guocb@chromium.org>
diff --git a/server/cros/provision.py b/server/cros/provision.py
index dc0c0bf..386f571 100644
--- a/server/cros/provision.py
+++ b/server/cros/provision.py
@@ -33,11 +33,6 @@
# Postfix -cheetsth to distinguish ChromeOS build during Cheets provisioning.
CHEETS_SUFFIX = '-cheetsth'
-# Default number of provisions attempts to try if we believe the devserver is
-# flaky.
-FLAKY_DEVSERVER_ATTEMPTS = 2
-
-
_Action = collections.namedtuple('_Action', 'name, value')
diff --git a/server/hosts/cros_host.py b/server/hosts/cros_host.py
index f0e959d..5939ec6 100644
--- a/server/hosts/cros_host.py
+++ b/server/hosts/cros_host.py
@@ -947,33 +947,7 @@
self.reboot(timeout=self.REBOOT_TIMEOUT, wait=True)
self.prepare_for_update()
- num_of_attempts = provision.FLAKY_DEVSERVER_ATTEMPTS
-
- while num_of_attempts > 0:
- num_of_attempts -= 1
- try:
- updater.run_update()
- except Exception:
- logging.warn('Autoupdate did not complete.')
- # Do additional check for the devserver health. Ideally,
- # the autoupdater.py could raise an exception when it
- # detected network flake but that would require
- # instrumenting the update engine and parsing it log.
- if (num_of_attempts <= 0 or
- devserver is None or
- dev_server.ImageServer.devserver_healthy(
- devserver.url())):
- raise
-
- logging.warn('Devserver looks unhealthy. Trying another')
- update_url, devserver = self._stage_image_for_update(
- requested_build)
- logging.debug('New Update URL is %s', update_url)
- updater = autoupdater.ChromiumOSUpdater(
- update_url, host=self,
- local_devserver=local_devserver)
- else:
- break
+ updater.run_update()
# Give it some time in case of IO issues.
time.sleep(10)