From 19f207ed4250c3ed1fd5de59ee4322523b9c82a8 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Thu, 21 Jan 2016 11:31:45 +0100 Subject: [PATCH] Don't crash on bad log path. --- src/modules/umount/main.py | 9 +++++---- src/modules/umount/umount.conf | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/modules/umount/main.py b/src/modules/umount/main.py index ed0f22679..2d00096ce 100644 --- a/src/modules/umount/main.py +++ b/src/modules/umount/main.py @@ -51,11 +51,12 @@ def run(): root_mount_point = libcalamares.globalstorage.value("rootMountPoint") log_source = libcalamares.job.configuration["srcLog"] log_destination = libcalamares.job.configuration["destLog"] - + # copy installation log before umount - if(os.path.exists('{!s}'.format(log_source))): - shutil.copy2('{!s}'.format(log_source), '{!s}/{!s}'.format( - root_mount_point, log_destination)) + if(log_source) + if(os.path.exists('{!s}'.format(log_source))): + shutil.copy2('{!s}'.format(log_source), '{!s}/{!s}'.format( + root_mount_point, log_destination)) if not root_mount_point: return ("No mount point for root partition in globalstorage", diff --git a/src/modules/umount/umount.conf b/src/modules/umount/umount.conf index 4dc0a8176..98c04fff2 100644 --- a/src/modules/umount/umount.conf +++ b/src/modules/umount/umount.conf @@ -1,6 +1,6 @@ --- -scrLog: "/path/to/installation.log" -destLog: "/var/log/installation.log" +#scrLog: "/path/to/installation.log" +#destLog: "/var/log/installation.log" # example when using the Calamares created log: #srcLog: "/root/.cache/Calamares/Calamares/Calamares.log" #destLog: "/var/log/Calamares.log"