2015-05-08 15:39:06 +00:00
|
|
|
#!/usr/bin/python3
|
2011-09-24 00:36:09 +00:00
|
|
|
#
|
|
|
|
# Live Media Creator
|
|
|
|
#
|
2018-04-27 00:09:05 +00:00
|
|
|
# Copyright (C) 2011-2018 Red Hat, Inc.
|
2011-09-24 00:36:09 +00:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
import logging
|
|
|
|
log = logging.getLogger("livemedia-creator")
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import tempfile
|
|
|
|
import shutil
|
2014-07-30 15:59:27 +00:00
|
|
|
import glob
|
2016-03-24 21:10:14 +00:00
|
|
|
import selinux
|
2011-09-24 00:36:09 +00:00
|
|
|
|
|
|
|
# Use pykickstart to calculate disk image size
|
|
|
|
from pykickstart.parser import KickstartParser
|
|
|
|
from pykickstart.version import makeVersion
|
2015-11-16 22:07:32 +00:00
|
|
|
from pykickstart.constants import KS_SHUTDOWN
|
2011-09-24 00:36:09 +00:00
|
|
|
|
|
|
|
# Use the Lorax treebuilder branch for iso creation
|
2018-04-27 00:09:05 +00:00
|
|
|
from pylorax import setup_logging, find_templates, vernum
|
2016-03-18 21:24:31 +00:00
|
|
|
from pylorax.cmdline import lmc_parser
|
2018-04-27 00:09:05 +00:00
|
|
|
from pylorax.creator import make_image, make_squashfs, make_livecd, make_runtime, make_appliance, make_live_images
|
|
|
|
from pylorax.creator import calculate_disk_size
|
|
|
|
from pylorax.imgutils import PartitionMount
|
|
|
|
from pylorax.imgutils import Mount
|
|
|
|
from pylorax.imgutils import copytree
|
|
|
|
from pylorax.installer import InstallError
|
|
|
|
from pylorax.sysutils import joinpaths
|
2014-07-30 15:59:27 +00:00
|
|
|
|
|
|
|
|
2016-03-29 00:20:49 +00:00
|
|
|
def default_image_name(compression, basename):
|
|
|
|
""" Return a default image name with the correct suffix for the compression type.
|
|
|
|
|
|
|
|
:param str compression: Compression type
|
|
|
|
:param str basename: Base filename
|
|
|
|
:returns: basename with compression suffix
|
|
|
|
|
|
|
|
If the compression is unknown it defaults to xz
|
|
|
|
"""
|
|
|
|
SUFFIXES = {"xz": ".xz", "gzip": ".gz", "bzip2": ".bz2", "lzma": ".lzma"}
|
|
|
|
return basename + SUFFIXES.get(compression, ".xz")
|
|
|
|
|
|
|
|
|
2014-05-09 00:22:14 +00:00
|
|
|
def main():
|
2016-03-18 21:24:31 +00:00
|
|
|
parser = lmc_parser()
|
2011-09-24 00:36:09 +00:00
|
|
|
opts = parser.parse_args()
|
|
|
|
|
2015-05-27 17:36:40 +00:00
|
|
|
setup_logging(opts.logfile, log)
|
2011-09-24 00:36:09 +00:00
|
|
|
|
|
|
|
log.debug( opts )
|
|
|
|
|
2017-08-08 22:14:15 +00:00
|
|
|
log.info("livemedia-creator v%s", vernum)
|
|
|
|
|
2016-02-11 18:50:46 +00:00
|
|
|
# Find the lorax templates
|
|
|
|
opts.lorax_templates = find_templates(opts.lorax_templates or "/usr/share/lorax")
|
|
|
|
|
2014-04-03 17:22:54 +00:00
|
|
|
# Check for invalid combinations of options, print all the errors and exit.
|
|
|
|
errors = []
|
|
|
|
if not opts.disk_image and not opts.fs_image and not opts.ks:
|
|
|
|
errors.append("Image creation requires a kickstart file")
|
|
|
|
|
|
|
|
if opts.ks and not os.path.exists(opts.ks[0]):
|
|
|
|
errors.append("kickstart file (%s) is missing." % opts.ks[0])
|
2011-09-24 00:36:09 +00:00
|
|
|
|
2016-02-11 18:50:46 +00:00
|
|
|
if opts.make_iso and not os.path.exists(opts.lorax_templates):
|
2014-04-03 17:22:54 +00:00
|
|
|
errors.append("The lorax templates directory (%s) doesn't "
|
|
|
|
"exist." % opts.lorax_templates)
|
2011-09-24 00:36:09 +00:00
|
|
|
|
|
|
|
if opts.result_dir and os.path.exists(opts.result_dir):
|
2014-04-03 17:22:54 +00:00
|
|
|
errors.append("The results_dir (%s) should not exist, please delete or "
|
|
|
|
"move its contents" % opts.result_dir)
|
2011-09-24 00:36:09 +00:00
|
|
|
|
2016-01-07 18:16:07 +00:00
|
|
|
# Default to putting results under tmp
|
|
|
|
if not opts.result_dir:
|
|
|
|
opts.result_dir = opts.tmp
|
|
|
|
|
2014-05-09 16:28:01 +00:00
|
|
|
if opts.iso and not os.path.exists(opts.iso):
|
2014-04-03 17:22:54 +00:00
|
|
|
errors.append("The iso %s is missing." % opts.iso)
|
2011-09-24 00:36:09 +00:00
|
|
|
|
2014-05-09 16:28:01 +00:00
|
|
|
if opts.disk_image and not os.path.exists(opts.disk_image):
|
2014-04-03 17:22:54 +00:00
|
|
|
errors.append("The disk image %s is missing." % opts.disk_image)
|
2011-09-24 00:36:09 +00:00
|
|
|
|
2014-05-09 16:28:01 +00:00
|
|
|
if opts.fs_image and not os.path.exists(opts.fs_image):
|
2014-04-03 17:22:54 +00:00
|
|
|
errors.append("The filesystem image %s is missing." % opts.fs_image)
|
2013-01-30 22:16:25 +00:00
|
|
|
|
|
|
|
is_install = not (opts.disk_image or opts.fs_image)
|
|
|
|
if is_install and not opts.no_virt and not opts.iso:
|
2014-04-03 17:22:54 +00:00
|
|
|
errors.append("virt install needs an install iso.")
|
2011-09-24 00:36:09 +00:00
|
|
|
|
2012-03-08 01:29:31 +00:00
|
|
|
if opts.volid and len(opts.volid) > 32:
|
2014-04-03 17:22:54 +00:00
|
|
|
errors.append("the volume id cannot be longer than 32 characters")
|
2012-03-08 01:29:31 +00:00
|
|
|
|
2013-01-30 22:16:25 +00:00
|
|
|
if is_install and not opts.no_virt \
|
2016-01-06 00:49:40 +00:00
|
|
|
and not any(glob.glob("/usr/bin/qemu-system-*")):
|
|
|
|
errors.append("qemu needs to be installed.")
|
2012-05-10 21:21:42 +00:00
|
|
|
|
2013-05-24 19:20:56 +00:00
|
|
|
if is_install and opts.no_virt \
|
2013-01-30 22:16:25 +00:00
|
|
|
and not os.path.exists("/usr/sbin/anaconda"):
|
2014-04-03 17:22:54 +00:00
|
|
|
errors.append("no-virt requires anaconda to be installed.")
|
2012-05-24 22:55:46 +00:00
|
|
|
|
2016-03-24 21:10:14 +00:00
|
|
|
if is_install and opts.no_virt:
|
|
|
|
if selinux.is_selinux_enabled() and selinux.security_getenforce():
|
|
|
|
errors.append("selinux must be disabled or in Permissive mode.")
|
|
|
|
|
2012-05-24 22:55:46 +00:00
|
|
|
if opts.make_appliance and not opts.app_template:
|
|
|
|
opts.app_template = joinpaths(opts.lorax_templates,
|
|
|
|
"appliance/libvirt.tmpl")
|
|
|
|
|
|
|
|
if opts.make_appliance and not os.path.exists(opts.app_template):
|
2014-04-03 17:22:54 +00:00
|
|
|
errors.append("The appliance template (%s) doesn't "
|
|
|
|
"exist" % opts.app_template)
|
2012-05-24 22:55:46 +00:00
|
|
|
|
2015-03-20 00:22:16 +00:00
|
|
|
if opts.image_name and os.path.exists(joinpaths(opts.result_dir, opts.image_name)):
|
2014-04-03 17:22:54 +00:00
|
|
|
errors.append("The disk image to be created should not exist.")
|
2012-05-24 22:55:46 +00:00
|
|
|
|
2015-10-19 22:30:33 +00:00
|
|
|
# Vagrant creates a qcow2 inside a tar, turn on qcow2
|
|
|
|
if opts.make_vagrant:
|
2015-12-18 23:30:51 +00:00
|
|
|
opts.image_type = "qcow2"
|
|
|
|
|
|
|
|
# Alias --qcow2 to --image-type=qcow2
|
|
|
|
if opts.qcow2:
|
|
|
|
opts.image_type = "qcow2"
|
2015-10-19 22:30:33 +00:00
|
|
|
|
2015-12-18 23:30:51 +00:00
|
|
|
if opts.image_type and not os.path.exists("/usr/bin/qemu-img"):
|
|
|
|
errors.append("image-type requires the qemu-img utility to be installed." % opts.image_type)
|
2014-03-08 02:43:14 +00:00
|
|
|
|
2015-12-18 23:30:51 +00:00
|
|
|
if opts.image_type and opts.make_iso:
|
|
|
|
errors.append("image-type cannot be used to make a bootable iso.")
|
2014-04-03 17:22:54 +00:00
|
|
|
|
2015-12-18 23:30:51 +00:00
|
|
|
if opts.image_type and opts.make_fsimage:
|
|
|
|
errors.append("image-type cannot be used to make filesystem images.")
|
2014-04-03 17:22:54 +00:00
|
|
|
|
2015-12-18 23:30:51 +00:00
|
|
|
if opts.image_type and opts.make_tar:
|
|
|
|
errors.append("image-type cannot be used to make a tar.")
|
2014-04-04 21:38:51 +00:00
|
|
|
|
2015-10-19 22:35:50 +00:00
|
|
|
if opts.make_oci and not (opts.oci_config and opts.oci_runtime):
|
|
|
|
errors.append("--make-oci requires --oci-config and --oci-runtime")
|
|
|
|
|
2015-10-20 21:23:33 +00:00
|
|
|
if opts.make_oci and not os.path.exists(opts.oci_config):
|
|
|
|
errors.append("oci % file is missing" % opts.oci_config)
|
|
|
|
|
|
|
|
if opts.make_oci and not os.path.exists(opts.oci_runtime):
|
|
|
|
errors.append("oci % file is missing" % opts.oci_runtime)
|
|
|
|
|
2015-10-21 00:28:10 +00:00
|
|
|
if opts.make_vagrant and opts.vagrant_metadata and not os.path.exists(opts.vagrant_metadata):
|
|
|
|
errors.append("Vagrant metadata file %s is missing" % opts.vagrant_metadata)
|
|
|
|
|
2015-11-04 02:03:09 +00:00
|
|
|
if opts.virt_uefi and not os.path.isdir(opts.ovmf_path):
|
|
|
|
errors.append("The OVMF firmware is missing from %s" % opts.ovmf_path)
|
2016-05-17 23:44:22 +00:00
|
|
|
elif opts.virt_uefi and os.path.isdir(opts.ovmf_path):
|
|
|
|
for f in ["OVMF_CODE.fd", "OVMF_VARS.fd"]:
|
|
|
|
if not os.path.exists(joinpaths(opts.ovmf_path, f)):
|
|
|
|
errors.append("OVMF firmware file %s is missing from %s" % (f, opts.ovmf_path))
|
2015-11-04 02:03:09 +00:00
|
|
|
|
2014-04-03 17:22:54 +00:00
|
|
|
if os.getuid() != 0:
|
|
|
|
errors.append("You need to run this as root")
|
2014-03-08 02:43:14 +00:00
|
|
|
|
2014-04-03 17:22:54 +00:00
|
|
|
if errors:
|
2015-05-08 15:39:06 +00:00
|
|
|
list(log.error(e) for e in errors)
|
2014-04-03 17:22:54 +00:00
|
|
|
sys.exit(1)
|
2014-04-02 23:56:28 +00:00
|
|
|
|
2016-01-07 18:16:07 +00:00
|
|
|
if not os.path.exists(opts.result_dir):
|
2015-05-08 15:39:06 +00:00
|
|
|
os.makedirs(opts.result_dir)
|
|
|
|
|
2014-04-02 23:56:28 +00:00
|
|
|
# AMI image is just a fsimage with an AMI label
|
|
|
|
if opts.make_ami:
|
|
|
|
opts.make_fsimage = True
|
|
|
|
if not opts.image_name:
|
|
|
|
opts.image_name = "ami-root.img"
|
|
|
|
if opts.fs_label == "Anaconda":
|
|
|
|
opts.fs_label = "AMI"
|
2014-04-04 21:38:51 +00:00
|
|
|
elif opts.make_tar:
|
|
|
|
if not opts.image_name:
|
2016-03-29 00:20:49 +00:00
|
|
|
opts.image_name = default_image_name(opts.compression, "root.tar")
|
2014-04-04 21:38:51 +00:00
|
|
|
if opts.compression == "xz" and not opts.compress_args:
|
|
|
|
opts.compress_args = ["-9"]
|
2015-10-19 22:35:50 +00:00
|
|
|
elif opts.make_oci:
|
|
|
|
if not opts.image_name:
|
2016-03-29 00:20:49 +00:00
|
|
|
opts.image_name = default_image_name(opts.compression, "bundle.tar")
|
2015-10-19 22:35:50 +00:00
|
|
|
if opts.compression == "xz" and not opts.compress_args:
|
|
|
|
opts.compress_args = ["-9"]
|
2015-10-19 22:30:33 +00:00
|
|
|
elif opts.make_vagrant:
|
|
|
|
if not opts.image_name:
|
2016-03-29 00:20:49 +00:00
|
|
|
opts.image_name = default_image_name(opts.compression, "vagrant.tar")
|
2015-10-19 22:30:33 +00:00
|
|
|
if opts.compression == "xz" and not opts.compress_args:
|
|
|
|
opts.compress_args = ["-9"]
|
2014-04-02 23:56:28 +00:00
|
|
|
|
2012-05-24 22:55:46 +00:00
|
|
|
if opts.app_file:
|
2015-03-20 00:22:16 +00:00
|
|
|
opts.app_file = joinpaths(opts.result_dir, opts.app_file)
|
2012-05-24 22:55:46 +00:00
|
|
|
|
2014-07-30 15:59:27 +00:00
|
|
|
if opts.make_ostree_live:
|
|
|
|
opts.make_pxe_live = True
|
|
|
|
opts.ostree = True
|
|
|
|
else:
|
|
|
|
opts.ostree = False
|
|
|
|
|
2012-05-11 20:12:17 +00:00
|
|
|
tempfile.tempdir = opts.tmp
|
2012-05-24 22:55:46 +00:00
|
|
|
disk_img = None
|
2012-05-11 20:12:17 +00:00
|
|
|
|
2012-05-24 22:55:46 +00:00
|
|
|
# Parse the kickstart
|
|
|
|
if opts.ks:
|
2011-09-24 00:36:09 +00:00
|
|
|
ks_version = makeVersion()
|
2014-05-09 16:28:01 +00:00
|
|
|
ks = KickstartParser(ks_version, errorsAreFatal=False, missingIncludeIsFatal=False)
|
|
|
|
ks.readKickstart(opts.ks[0])
|
2012-05-24 22:55:46 +00:00
|
|
|
|
2016-04-05 23:15:30 +00:00
|
|
|
# live iso usually needs dracut-live so warn the user if it is missing
|
|
|
|
if opts.ks and opts.make_iso:
|
|
|
|
if "dracut-live" not in ks.handler.packages.packageList:
|
|
|
|
log.error("dracut-live package is missing from the kickstart.")
|
|
|
|
sys.exit(1)
|
|
|
|
|
2013-01-30 22:16:25 +00:00
|
|
|
# Make the disk or filesystem image
|
|
|
|
if not opts.disk_image and not opts.fs_image:
|
|
|
|
errors = []
|
2016-04-21 17:29:18 +00:00
|
|
|
if opts.no_virt and ks.handler.method.method not in ("url", "nfs") \
|
|
|
|
and not ks.handler.ostreesetup.seen:
|
|
|
|
errors.append("Only url, nfs and ostreesetup install methods are currently supported."
|
|
|
|
"Please fix your kickstart file." )
|
2011-09-24 00:36:09 +00:00
|
|
|
|
2015-12-01 08:34:00 +00:00
|
|
|
if ks.handler.method.method in ("url", "nfs") and not ks.handler.network.seen:
|
|
|
|
errors.append("The kickstart must activate networking if "
|
|
|
|
"the url or nfs install method is used.")
|
|
|
|
|
2013-01-30 22:16:25 +00:00
|
|
|
if ks.handler.displaymode.displayMode is not None:
|
|
|
|
errors.append("The kickstart must not set a display mode (text, cmdline, "
|
|
|
|
"graphical), this will interfere with livemedia-creator.")
|
2011-09-24 00:36:09 +00:00
|
|
|
|
2016-04-21 17:29:18 +00:00
|
|
|
if opts.make_fsimage or (opts.make_pxe_live and opts.no_virt):
|
2014-04-03 17:45:06 +00:00
|
|
|
# Make sure the kickstart isn't using autopart and only has a / mountpoint
|
|
|
|
part_ok = not any(p for p in ks.handler.partition.partitions
|
|
|
|
if p.mountpoint not in ["/", "swap"])
|
|
|
|
if not part_ok or ks.handler.autopart.seen:
|
|
|
|
errors.append("Filesystem images must use a single / part, not autopart or "
|
|
|
|
"multiple partitions. swap is allowed but not used.")
|
2014-04-02 23:56:28 +00:00
|
|
|
|
2015-11-16 22:07:32 +00:00
|
|
|
if not opts.no_virt and ks.handler.reboot.action != KS_SHUTDOWN:
|
|
|
|
errors.append("The kickstart must include shutdown when using virt installation.")
|
|
|
|
|
2013-01-30 22:16:25 +00:00
|
|
|
if errors:
|
2015-05-08 15:39:06 +00:00
|
|
|
list(log.error(e) for e in errors)
|
2013-01-30 22:16:25 +00:00
|
|
|
sys.exit(1)
|
2011-12-09 01:12:06 +00:00
|
|
|
|
2013-01-30 22:16:25 +00:00
|
|
|
# Make the image. Output of this is either a partitioned disk image or a fsimage
|
|
|
|
try:
|
|
|
|
disk_img = make_image(opts, ks)
|
|
|
|
except InstallError as e:
|
2014-05-09 00:22:14 +00:00
|
|
|
log.error("ERROR: Image creation failed: %s", e)
|
2013-01-30 22:16:25 +00:00
|
|
|
sys.exit(1)
|
2012-05-12 00:35:16 +00:00
|
|
|
|
2017-01-08 13:18:17 +00:00
|
|
|
result_dir = None
|
2013-01-30 22:16:25 +00:00
|
|
|
if not opts.image_only:
|
|
|
|
if opts.make_iso:
|
2016-01-07 22:32:48 +00:00
|
|
|
work_dir = tempfile.mkdtemp(prefix="lmc-work-")
|
2015-05-01 00:10:08 +00:00
|
|
|
log.info("working dir is %s", work_dir)
|
2013-01-30 22:16:25 +00:00
|
|
|
|
|
|
|
if (opts.fs_image or opts.no_virt) and not opts.disk_image:
|
|
|
|
# Create iso from a filesystem image
|
|
|
|
disk_img = opts.fs_image or disk_img
|
|
|
|
|
2016-03-24 22:52:29 +00:00
|
|
|
if not make_squashfs(opts, disk_img, work_dir):
|
2016-03-09 22:29:18 +00:00
|
|
|
log.error("squashfs.img creation failed")
|
|
|
|
sys.exit(1)
|
|
|
|
|
2013-01-30 22:16:25 +00:00
|
|
|
with Mount(disk_img, opts="loop") as mount_dir:
|
|
|
|
result_dir = make_livecd(opts, mount_dir, work_dir)
|
|
|
|
else:
|
|
|
|
# Create iso from a partitioned disk image
|
|
|
|
disk_img = opts.disk_image or disk_img
|
|
|
|
with PartitionMount(disk_img) as img_mount:
|
|
|
|
if img_mount and img_mount.mount_dir:
|
2016-03-21 19:14:28 +00:00
|
|
|
make_runtime(opts, img_mount.mount_dir, work_dir, calculate_disk_size(opts, ks)/1024.0)
|
2013-01-30 22:16:25 +00:00
|
|
|
result_dir = make_livecd(opts, img_mount.mount_dir, work_dir)
|
|
|
|
|
2016-01-07 18:16:07 +00:00
|
|
|
# --iso-only removes the extra build artifacts, keeping only the boot.iso
|
|
|
|
if opts.iso_only and result_dir:
|
|
|
|
boot_iso = joinpaths(result_dir, "images/boot.iso")
|
|
|
|
if not os.path.exists(boot_iso):
|
|
|
|
log.error("%s is missing, skipping --iso-only.", boot_iso)
|
|
|
|
else:
|
|
|
|
iso_dir = tempfile.mkdtemp(prefix="lmc-result-")
|
2016-01-11 17:54:40 +00:00
|
|
|
dest_file = joinpaths(iso_dir, opts.iso_name or "boot.iso")
|
2016-01-07 18:16:07 +00:00
|
|
|
shutil.move(boot_iso, dest_file)
|
|
|
|
shutil.rmtree(result_dir)
|
|
|
|
result_dir = iso_dir
|
|
|
|
|
2013-01-30 22:16:25 +00:00
|
|
|
# cleanup the mess
|
|
|
|
# cleanup work_dir?
|
|
|
|
if disk_img and not (opts.keep_image or opts.disk_image or opts.fs_image):
|
|
|
|
os.unlink(disk_img)
|
|
|
|
log.info("Disk image erased")
|
|
|
|
disk_img = None
|
|
|
|
elif opts.make_appliance:
|
|
|
|
if not opts.ks:
|
|
|
|
networks = []
|
|
|
|
else:
|
|
|
|
networks = ks.handler.network.network
|
|
|
|
make_appliance(opts.disk_image or disk_img, opts.app_name,
|
|
|
|
opts.app_template, opts.app_file, networks, opts.ram,
|
2015-11-13 21:46:08 +00:00
|
|
|
opts.vcpus or 1, opts.arch, opts.title, opts.project, opts.releasever)
|
2014-07-30 15:59:27 +00:00
|
|
|
elif opts.make_pxe_live:
|
2016-01-07 22:32:48 +00:00
|
|
|
work_dir = tempfile.mkdtemp(prefix="lmc-work-")
|
2015-05-01 00:10:08 +00:00
|
|
|
log.info("working dir is %s", work_dir)
|
2016-07-31 22:31:09 +00:00
|
|
|
disk_img = opts.fs_image or opts.disk_image or disk_img
|
2016-04-26 21:37:19 +00:00
|
|
|
log.debug("disk image is %s", disk_img)
|
2014-07-30 15:59:27 +00:00
|
|
|
|
2016-04-26 21:37:19 +00:00
|
|
|
result_dir = make_live_images(opts, work_dir, disk_img)
|
2016-03-09 22:29:18 +00:00
|
|
|
if result_dir is None:
|
2016-04-26 21:37:19 +00:00
|
|
|
log.error("Creating PXE live image failed.")
|
2016-03-09 22:29:18 +00:00
|
|
|
sys.exit(1)
|
2013-01-30 22:16:25 +00:00
|
|
|
|
2015-03-20 00:22:16 +00:00
|
|
|
if opts.result_dir != opts.tmp and result_dir:
|
2016-01-07 18:16:07 +00:00
|
|
|
copytree(result_dir, opts.result_dir, preserve=False)
|
2014-05-09 16:28:01 +00:00
|
|
|
shutil.rmtree(result_dir)
|
2016-01-07 18:16:07 +00:00
|
|
|
result_dir = None
|
2011-09-24 00:36:09 +00:00
|
|
|
|
|
|
|
log.info("SUMMARY")
|
|
|
|
log.info("-------")
|
2015-05-01 00:10:08 +00:00
|
|
|
log.info("Logs are in %s", os.path.abspath(os.path.dirname(opts.logfile)))
|
2012-05-24 22:55:46 +00:00
|
|
|
if disk_img:
|
2015-05-01 00:10:08 +00:00
|
|
|
log.info("Disk image is at %s", disk_img)
|
2012-05-24 22:55:46 +00:00
|
|
|
if opts.make_appliance:
|
2015-05-01 00:10:08 +00:00
|
|
|
log.info("Appliance description is in %s", opts.app_file)
|
2016-01-07 18:16:07 +00:00
|
|
|
log.info("Results are in %s", result_dir or opts.result_dir)
|
2011-09-24 00:36:09 +00:00
|
|
|
|
|
|
|
sys.exit( 0 )
|
|
|
|
|
2014-05-09 00:22:14 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|