Merge in cl/202983157

"workaround issue with launching release branch cuttlefish instance"

Bug: None
Test: ./run_tests.sh, m acloud && acloud
Change-Id: Ibed4a3826d722b5a90d9e23d4fd2f09aa560390f
diff --git a/public/actions/create_cuttlefish_action.py b/public/actions/create_cuttlefish_action.py
index b5b1903..e116330 100644
--- a/public/actions/create_cuttlefish_action.py
+++ b/public/actions/create_cuttlefish_action.py
@@ -47,6 +47,9 @@
 
     """
 
+    RELEASE_BRANCH_SUFFIX = "-release"
+    RELEASE_BRANCH_PATH_GLOB_PATTERN = "*-%s"
+
     def __init__(self, cfg, build_target, build_id, kernel_build_id=None):
 
         self.credentials = auth.CreateCredentials(cfg, ALL_SCOPES)
@@ -88,13 +91,18 @@
         instance = self._compute_client.GenerateInstanceName(self._build_id)
 
         # Create an instance from Stable Host Image
+        if self.RELEASE_BRANCH_SUFFIX in self._branch:
+            # Workaround for release branch builds.
+            bid = self.RELEASE_BRANCH_PATH_GLOB_PATTERN % self._build_id
+        else:
+            bid = self._build_id
         self._compute_client.CreateInstance(
             instance=instance,
             image_name=self._cfg.stable_host_image_name,
             image_project=self._cfg.stable_host_image_project,
             build_target=self._build_target,
             branch=self._branch,
-            build_id=self._build_id,
+            build_id=bid,
             kernel_branch=self._kernel_branch,
             kernel_build_id=self._kernel_build_id,
             blank_data_disk_size_gb=self._blank_data_disk_size_gb)