Commit f9153c84 authored by Nikos Skalkotos's avatar Nikos Skalkotos

Fix an some error messages in snf-image-creator

parent e56edd29
......@@ -206,7 +206,7 @@ def image_creator():
image = disk.get_image(snapshot)
# If no customization is to be applied, the image should be mounted ro
# If no customization is to be done, the image should be mounted ro
ro = (not (options.sysprep or options.shrink) or options.print_sysprep)
image.mount(ro)
try:
......@@ -224,12 +224,13 @@ def image_creator():
return 0
if options.sysprep:
err_msg = "Unable to apply the system preparation tasks."
err_msg = "Unable to perform the system preparation tasks. " \
"Couldn't mount the media%s. Use --no-sysprep if you " \
"don't won't to perform any system preparation task."
if not image.mounted:
raise FatalError("%s Couldn't mount the media." % err_msg)
raise FatalError(err_msg % "")
elif image.mounted_ro:
raise FatalError("%s Couldn't mount the media read-write."
% err_msg)
raise FatalError(err_msg % " read-write")
image.os.do_sysprep()
metadata = image.os.meta
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment