From 8641caca9ef3bcd28fa75a2ce5ca180e06c53e2d Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Wed, 14 Jan 2015 09:36:38 -0800 Subject: [PATCH] livemedia-creator: Create parent dirs for logfile path The directory where the --logfile is located is also used for other log files and for the anaconda logs when using --no-virt. Create the parent directories if they don't exist. --- src/sbin/livemedia-creator | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator index 683612d5..4d66c392 100755 --- a/src/sbin/livemedia-creator +++ b/src/sbin/livemedia-creator @@ -1093,6 +1093,9 @@ def setup_logging(opts): :param opts: options passed to livemedia-creator :type opts: argparse options """ + if not os.path.isdir(os.path.abspath(os.path.dirname(opts.logfile))): + os.makedirs(os.path.abspath(os.path.dirname(opts.logfile))) + # Setup logging to console and to logfile log.setLevel(logging.DEBUG) pylorax_log.setLevel(logging.DEBUG)