Revision 71b0ab28 image_creator/dialog_menu.py

b/image_creator/dialog_menu.py
38 38
import StringIO
39 39

  
40 40
from image_creator import __version__ as version
41
from image_creator.util import MD5
41
from image_creator.util import MD5, FatalError
42 42
from image_creator.output.dialog import GaugeOutput, InfoBoxOutput
43 43
from image_creator.kamaki_wrapper import Kamaki, ClientError
44 44
from image_creator.help import get_help_file
......
568 568
            try:
569 569
                image.out.add(infobox)
570 570
                try:
571
                    image.mount(readonly=False)
572
                    try:
573
                        err = "Unable to execute the system preparation " \
574
                            "tasks. Couldn't mount the media%s."
575
                        title = "System Preparation"
576
                        if not image.mounted:
577
                            d.msgbox(err % "", title=title, width=SMALL_WIDTH)
578
                            return
579
                        elif image.mounted_ro:
580
                            d.msgbox(err % " read-write", title=title,
581
                                     width=SMALL_WIDTH)
582
                            return
583

  
584
                        # The checksum is invalid. We have mounted the image rw
585
                        if 'checksum' in session:
586
                            del session['checksum']
587

  
588
                        # Monitor the metadata changes during syspreps
589
                        with MetadataMonitor(session, image.os.meta):
571
                    # The checksum is invalid. We have mounted the image rw
572
                    if 'checksum' in session:
573
                        del session['checksum']
574

  
575
                    # Monitor the metadata changes during syspreps
576
                    with MetadataMonitor(session, image.os.meta):
577
                        try:
590 578
                            image.os.do_sysprep()
591 579
                            infobox.finalize()
592

  
593
                    finally:
594
                        image.umount()
580
                        except FatalError as e:
581
                            title = "System Preparation"
582
                            d.msgbox("System Preparation failed: %s" % e,
583
                                     title=title, width=SMALL_WIDTH)
595 584
                finally:
596 585
                    image.out.remove(infobox)
597 586
            finally:

Also available in: Unified diff