← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jtv/maas/1.1-backport-995 into lp:maas/12.04-nocobbler

 

Jeroen T. Vermeulen has proposed merging lp:~jtv/maas/1.1-backport-995 into lp:maas/12.04-nocobbler.

Commit message:
Backport trunk r995: missing error checking in maas-import-ephemerals.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jtv/maas/1.1-backport-995/+merge/130722

This has been in use in trunk for some time.  Backporting it required no changes.
-- 
https://code.launchpad.net/~jtv/maas/1.1-backport-995/+merge/130722
Your team MAAS Maintainers is subscribed to branch lp:maas/12.04-nocobbler.
=== modified file 'scripts/maas-import-ephemerals'
--- scripts/maas-import-ephemerals	2012-08-31 19:12:30 +0000
+++ scripts/maas-import-ephemerals	2012-10-22 03:33:18 +0000
@@ -292,13 +292,17 @@
 
     for filename in linux initrd.gz
     do
-        cp -- "$src/$filename" "$tmpdir/"
+        cp -- "$src/$filename" "$tmpdir/" ||
+            { error "cp of $filename from $src failed"; return 1; }
     done
 
-    debug 1 "maas-provision install-pxe-image --arch=$arch --subarch=$subarch --release=$release --purpose=commissioning --image=$tmpdir"
-    maas-provision install-pxe-image \
-        --arch=$arch --subarch=$subarch --release=$release \
-        --purpose="commissioning" --image="$tmpdir"
+    local cmd
+    cmd=( maas-provision install-pxe-image
+          "--arch=$arch" "--subarch=$subarch" "--release=$release"
+          --purpose="commissioning" --image="$tmpdir" )
+    debug 1 "${cmd[@]}"
+    "${cmd[@]}" ||
+        { error "cmd failed:" "${cmd[@]}"; return 1; }
 }
 
 
@@ -352,6 +356,7 @@
         query_remote "$arch_u" "$release" "$BUILD_NAME" ||
             fail "remote query of $REMOTE_IMAGES_MIRROR failed"
 
+        info="rel: $r_release, arch: $r_arch: name: $r_name"
         if [ -z "$l_dir" ]; then
             serial_gt "$r_serial" "$l_serial" || {
                 debug 1 "$release-${arch_u} in ${l_dir} is up to date";
@@ -368,7 +373,8 @@
                 "$r_serial" "$r_arch" "$r_url" "$r_name" ||
                 fail "failed to prepare image for $release/$arch"
 
-            install_tftp_image "$wd" "$r_arch" "generic" "$r_release"
+            install_tftp_image "$wd" "$r_arch" "generic" "$r_release" ||
+                fail "failed to install ftp image [$info]"
 
             target_name="${TARGET_NAME_PREFIX}${r_name}"
 
@@ -385,7 +391,8 @@
 
             # Even if there was no need to update the image, we make sure it
             # gets installed.
-            install_tftp_image "$fpfinal_d" "$r_arch" "generic" "$r_release"
+            install_tftp_image "$fpfinal_d" "$r_arch" "generic" "$r_release" ||
+                fail "failed to install ftp image [$info]"
 
             name="${l_name}"
             target_name="${TARGET_NAME_PREFIX}${name}"


Follow ups