Merge ~mwhudson/ubiquity:lp-1847898 into ubiquity:master

Proposed by Michael Hudson-Doyle
Status: Merged
Merged at revision: 50fc6e0f9afbdfddafb2f616972dc6887d5adbc8
Proposed branch: ~mwhudson/ubiquity:lp-1847898
Merge into: ubiquity:master
Diff against target: 29 lines (+13/-1)
1 file modified
ubiquity/misc.py (+13/-1)
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Approve
Review via email: mp+383762@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I haven't tested this yet.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I have now tested this and it worked for me.

Revision history for this message
Dimitri John Ledkov (xnox) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/ubiquity/misc.py b/ubiquity/misc.py
index c0b0536..ad40a49 100644
--- a/ubiquity/misc.py
+++ b/ubiquity/misc.py
@@ -371,11 +371,23 @@ def grub_default(boot=None):
371371
372 devices = grub_device_map()372 devices = grub_device_map()
373 target = None373 target = None
374 if devices:374
375 if boot is not None:
376 for device in devices:
377 try:
378 candidate = os.path.realpath(device.split('\t')[1])
379 except (IndexError, OSError):
380 pass
381 if candidate == boot:
382 target = candidate
383 break
384
385 if target is None and devices:
375 try:386 try:
376 target = os.path.realpath(devices[0].split('\t')[1])387 target = os.path.realpath(devices[0].split('\t')[1])
377 except (IndexError, OSError):388 except (IndexError, OSError):
378 pass389 pass
390
379 # last resort391 # last resort
380 if target is None:392 if target is None:
381 target = '(hd0)'393 target = '(hd0)'

Subscribers

People subscribed via source and target branches