diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 395: 1. fetch-image-ui now examines the return code of linaro-media-create and reports failures to the...

Message ID 20110727212542.22477.82648.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

James Tunnicliffe July 27, 2011, 9:25 p.m. UTC
Merge authors:
  James Tunnicliffe (dooferlad)
Related merge proposals:
  https://code.launchpad.net/~dooferlad/linaro-image-tools/fetch-image-ui_use_l-m-c_return_code2/+merge/69544
  proposed by: James Tunnicliffe (dooferlad)
------------------------------------------------------------
revno: 395 [merge]
committer: James Tunnicliffe <james.tunnicliffe@linaro.org>
branch nick: linaro-image-tools
timestamp: Wed 2011-07-27 22:23:15 +0100
message:
  1. fetch-image-ui now examines the return code of linaro-media-create and reports failures to the UI.
  2. The image_size parameter to linaro-media-create wasn't being passed. This resulted in linaro-fetch-image being unable to create Ubuntu Desktop disk images, which now need to be larger than the default size of 2GB.
modified:
  linaro-fetch-image-ui
  linaro_image_tools/fetch_image.py


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro-fetch-image-ui'
--- linaro-fetch-image-ui	2011-07-22 21:09:29 +0000
+++ linaro-fetch-image-ui	2011-07-27 19:37:38 +0000
@@ -1240,10 +1240,13 @@ 
             elif event[0] == "end":
                 self.event_end(event[1])
 
-            elif event == "terminate" or event[0] == "abort":
+            elif event == "terminate" or event == "abort":
                 # Process complete. Enable next button.
                 self.wizard.FindWindowById(wx.ID_FORWARD).Enable()
-                self.populate_file_system_status.SetLabel("Done")
+                if event == "terminate":
+                    self.populate_file_system_status.SetLabel("Done")
+                else:
+                    self.populate_file_system_status.SetLabel("Failed")
                 return  # Even if queue isn't empty, stop processing it
 
             elif event[0] == "update":

=== modified file 'linaro_image_tools/fetch_image.py'
--- linaro_image_tools/fetch_image.py	2011-07-26 10:56:17 +0000
+++ linaro_image_tools/fetch_image.py	2011-07-27 19:39:57 +0000
@@ -580,6 +580,7 @@ 
 
         self.append_setting_to(args, settings, 'mmc')
         self.append_setting_to(args, settings, 'image_file')
+        self.append_setting_to(args, settings, 'image_size')
         self.append_setting_to(args, settings, 'swap_size')
         self.append_setting_to(args, settings, 'swap_file')
         self.append_setting_to(args, settings, 'yes_to_mmc_selection',
@@ -681,10 +682,14 @@ 
             self.event_queue.put(("start", "unpack"))
 
             while(1):
-                if self.create_process.poll() != None:   # linaro-media-create
-                                                         # has finished.
-                    self.event_queue.put(("terminate"))  # Tell the GUI
-                    return                               # Terminate the thread
+                if self.create_process.poll() != None:
+                    # linaro-media-create has finished. Tell the GUI the return
+                    # code so it can report pass/fail.
+                    if self.create_process.returncode:
+                        self.event_queue.put("abort")
+                    else:
+                        self.event_queue.put("terminate")
+                    return
 
                 self.input = self.create_process.stdout.read(1)