Devserver pregenerate with xbuddy.

To prepare for an update request that expects the payload to already
have been pregenerated.

BUG=chromium:260491
TEST=Manual and unittest

Change-Id: I02002f13a466aa4991606f61c990a63ae2814cca
Reviewed-on: https://gerrit.chromium.org/gerrit/66157
Commit-Queue: Joy Chen <joychen@chromium.org>
Reviewed-by: Joy Chen <joychen@chromium.org>
Tested-by: Joy Chen <joychen@chromium.org>
diff --git a/autoupdate.py b/autoupdate.py
index 6507cdc..30f4562 100644
--- a/autoupdate.py
+++ b/autoupdate.py
@@ -654,6 +654,13 @@
       path_to_payload = self.GetUpdateForLabel(client_version, label)
     #TODO(joychen): deprecate --image flag
     elif self.forced_image:
+      if self.forced_image.startswith('xbuddy:'):
+        # This is trying to use an xbuddy path in place of a path to an image.
+        # Pretend to have called update with this update path to payload.
+        xbuddy_label = self.forced_image.split(':')[1]
+        self.forced_image = None
+        return self.GetPathToPayload(xbuddy_label, client_version, board)
+
       src_path = os.path.abspath(self.forced_image)
       if os.path.exists(src_path) and common_util.IsInsideChroot():
         # Image was found for the given label. Generate update if we can.