Check if the filesystem is mounted read-write before you execute
the do_sysprep function
try:
image.mount(readonly=False)
try:
+ err_msg = \
+ "Unable to execute the system preparation tasks."
+ if not image.mounted:
+ d.msgbox("%s Couldn't mount the media." % err_msg,
+ title="System Preperation", width=SMALL_WIDTH)
+ return
+ elif image.mounted_ro:
+ d.msgbox("%s Couldn't mount the media read-write."
+ % err_msg, title="System Preperation",
+ width=SMALL_WIDTH)
+ return
+
# The checksum is invalid. We have mounted the image rw
if 'checksum' in session:
del session['checksum']
#Sysprep
image.mount(False)
+ err_msg = "Unable to execute the system preparation tasks."
+ if not image.mounted:
+ raise FatalError("%s Couldn't mount the media." % err_msg)
+ elif image.mounted_ro:
+ raise FatalError("%s Couldn't mount the media read-write."
+ % err_msg)
image.os.do_sysprep()
metadata = image.os.meta
image.umount()
return 0
if options.sysprep:
+ err_msg = "Unable to apply the system preparation tasks."
+ if not image.mounted:
+ raise FatalError("%s Couldn't mount the media." % err_msg)
+ elif image.mounted_ro:
+ raise FatalError("%s Couldn't mount the media read-write."
+ % err_msg)
image.os.do_sysprep()
metadata = image.os.meta