quick-provision: Ensure that device reboots when checking provision.

If a device is slow to reboot, it was possible for the check to
erroneously check based on the original state before rebooting.

BUG=chromium:785065
CQ-DEPEND=CL:804894
TEST=build=veyron_rialto-paladin/R64-10083.0.0-rc2; curl "http://${ds}/stage?archive_url=gs://chromeos-image-archive/${build}&artifacts=quick_provision,stateful"; curl "http://${ds}/cros_au?full_update=False&force_update=True&build_name=${build}&host_name=${dut}&async=False&clobber_stateful=True&quick_provision=True"

Change-Id: I8933c8cc3a5aadb342c927c0fe12eafacc8fe899
Reviewed-on: https://chromium-review.googlesource.com/804961
Commit-Ready: David Riley <davidriley@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
diff --git a/cros_update.py b/cros_update.py
index 90e271b..49acfef 100644
--- a/cros_update.py
+++ b/cros_update.py
@@ -245,7 +245,7 @@
     key_re = re.compile(r'^KEYVAL: ([^\d\W]\w*)=(.*)$')
     matches = [key_re.match(l) for l in results.output.splitlines()]
     keyvals = {m.group(1): m.group(2) for m in matches if m}
-    logging.debug("DUT returned keyvals: %s" % keyvals)
+    logging.info("DUT returned keyvals: %s", keyvals)
     return keyvals
 
   def TriggerAU(self):
@@ -282,14 +282,15 @@
         # Allow fall back if the quick provision does not succeed.
         invoke_autoupdate = True
 
-        if self.quick_provision:
+        if (self.quick_provision and self.clobber_stateful and
+            not self.full_update):
           try:
             logging.debug('Start CrOS quick provision process...')
             self._WriteAUStatus('Start Quick Provision')
-            self._QuickProvision(device)
+            keyvals = self._QuickProvision(device)
             logging.debug('Start CrOS check process...')
             self._WriteAUStatus('Finish Quick Provision, post-check')
-            chromeos_AU.PostCheckCrOSUpdate()
+            chromeos_AU.PostCheckCrOSUpdate(keyvals.get('BOOT_ID'))
             self._WriteAUStatus(cros_update_progress.FINISHED)
             invoke_autoupdate = False
           except (cros_build_lib.RunCommandError,