out.clear()
#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()
#Shrink
size = image.shrink()