cros_flash: Add an --experimental-au flag

It is a good idea to use an --experimental-au flag to develop new
features and changes in cros flash (specifically auto-updater) without
breaking normal users. We can basically use this as a dog-fooding
option. It can be removed once crbug.com/872441 is fixed.

The same flag is passed to all auto_updater.py code too because there is
gonna be fundamental changes there too.

BUG=chromium:872441
TEST=unittest
TEST=cros flash --experimental-au

Change-Id: Ic1c3c697833f4d3265b1e744a3f97996c9ad7b9b
Reviewed-on: https://chromium-review.googlesource.com/1450316
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/cli/flash.py b/cli/flash.py
index 4f2c488..409e9b2 100644
--- a/cli/flash.py
+++ b/cli/flash.py
@@ -341,7 +341,8 @@
                rootfs_update=True, clobber_stateful=False, reboot=True,
                board=None, src_image_to_delta=None, wipe=True, debug=False,
                yes=False, force=False, ssh_private_key=None, ping=True,
-               disable_verification=False, send_payload_in_parallel=False):
+               disable_verification=False, send_payload_in_parallel=False,
+               experimental_au=False):
     """Initializes RemoteDeviceUpdater"""
     if not stateful_update and not rootfs_update:
       raise ValueError('No update operation to perform; either stateful or'
@@ -365,6 +366,7 @@
     self.yes = yes
     self.force = force
     self.send_payload_in_parallel = send_payload_in_parallel
+    self.experimental_au = experimental_au
 
   def Cleanup(self):
     """Cleans up the temporary directory."""
@@ -471,7 +473,8 @@
               disable_verification=self.disable_verification,
               clobber_stateful=self.clobber_stateful,
               yes=self.yes,
-              send_payload_in_parallel=self.send_payload_in_parallel)
+              send_payload_in_parallel=self.send_payload_in_parallel,
+              experimental_au=self.experimental_au)
           chromeos_AU.CheckPayloads()
           chromeos_AU.RunUpdate()
 
@@ -496,7 +499,8 @@
           rootfs_update=True, stateful_update=True, clobber_stateful=False,
           reboot=True, wipe=True, ssh_private_key=None, ping=True,
           disable_rootfs_verification=False, clear_cache=False, yes=False,
-          force=False, debug=False, send_payload_in_parallel=False):
+          force=False, debug=False, send_payload_in_parallel=False,
+          experimental_au=False):
   """Flashes a device, USB drive, or file with an image.
 
   This provides functionality common to `cros flash` and `brillo flash`
@@ -526,6 +530,8 @@
     debug: Print additional debugging messages.
     send_payload_in_parallel: Transfer payloads in chunks in parallel to speed
         up transmissions for long haul between endpoints.
+    experimental_au: Use the experimental features auto updater. It should be
+        deprecated once crbug.com/872441 is fixed.
 
   Raises:
     FlashError: An unrecoverable error occured.
@@ -573,7 +579,8 @@
         ssh_private_key=ssh_private_key,
         ping=ping,
         disable_verification=disable_rootfs_verification,
-        send_payload_in_parallel=send_payload_in_parallel)
+        send_payload_in_parallel=send_payload_in_parallel,
+        experimental_au=experimental_au)
     updater.Run()
   elif device.scheme == commandline.DEVICE_SCHEME_USB:
     path = osutils.ExpandPath(device.path) if device.path else ''