livemedia-creator: handle failed mount for ami

This commit is contained in:
Brian C. Lane 2012-05-22 13:11:53 -07:00
parent ee6be6ac67
commit 7a23c600c6

View File

@ -364,6 +364,9 @@ def make_ami( disk_img, ami_img="ami-root.img", ami_label="AMI" ):
All other AMI setup is handled by the kickstart's %post All other AMI setup is handled by the kickstart's %post
""" """
with PartitionMount( disk_img ) as img_mount: with PartitionMount( disk_img ) as img_mount:
if not img_mount or not img_mount.mount_dir:
return None
work_dir = tempfile.mkdtemp() work_dir = tempfile.mkdtemp()
log.info("working dir is {0}".format(work_dir)) log.info("working dir is {0}".format(work_dir))
log.info("creating {0}".format(ami_img)) log.info("creating {0}".format(ami_img))