container-guest-tools: Deal with gsutil

gsutil cp -r has semantics that depend on whether the target directory
already exists or not. If it does, the source directory will be
created under the target, otherwise the *contents* of the source
directory are copied directly under the (newly created) target. Make
sure we always target a directory that (shouldn't) exist by including
the build number in the target path.

TEST=Ran script

Disallow-Recycled-Builds: test-failures
Change-Id: Idd362a72e8d6533142613d8f08b77430f63fbd89
Reviewed-by: Nicholas Verne <>
Tested-by: kokoro <>
Commit-Queue: Fergus Dall <>
diff --git a/termina/ b/termina/
index 3002a4f..76f6635 100755
--- a/termina/
+++ b/termina/
@@ -42,7 +42,7 @@
         ["", "--", "cp", "-a", "public-read", local_copy, remote_copy])
-  subprocess.check_call(["", "--", "cp", "-r", omaha_url, testing_url])
+  subprocess.check_call(["", "--", "cp", "-r", omaha_url, '{}/{}'.format(testing_url, build)])
   with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp: