← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad-mojo-specs/+git/private:vbuilder-rebuild-script into ~launchpad/launchpad-mojo-specs/+git/private:vbuilder

 

Colin Watson has proposed merging ~cjwatson/launchpad-mojo-specs/+git/private:vbuilder-rebuild-script into ~launchpad/launchpad-mojo-specs/+git/private:vbuilder.

Commit message:
Rework rebuild-images to avoid using Juju actions

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad-mojo-specs/+git/private/+merge/425726

This is more robust against situations where Juju is too broken to run actions properly.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad-mojo-specs/+git/private:vbuilder-rebuild-script into ~launchpad/launchpad-mojo-specs/+git/private:vbuilder.
diff --git a/vbuilder/rebuild-images b/vbuilder/rebuild-images
index 79d61cb..e364b9e 100755
--- a/vbuilder/rebuild-images
+++ b/vbuilder/rebuild-images
@@ -50,11 +50,11 @@ def main():
     for region, arch, series in targets:
         application = f"glance-simplestreams-sync-{region}-{arch}"
         unit = get_leader_unit(juju_services, application)
-        run_action_cmd = [
-            "juju", "run-action", unit, "rebuild",
-            f"prefix={name_prefix}/ubuntu-{series}-daily-{arch}-",
+        rebuild_cmd = [
+            "juju", "ssh", unit, "sudo", "/usr/local/bin/rebuild-latest-image",
+            f"{name_prefix}/ubuntu-{series}-daily-{arch}-",
             ]
-        utils.run(None, run_action_cmd)
+        utils.run(None, rebuild_cmd)
 
 
 if __name__ == "__main__":

Follow ups