From ca9f4bc05348f11dc30eaa825839433d9eb24d29 Mon Sep 17 00:00:00 2001 From: Philip Date: Thu, 28 Jul 2016 02:00:47 +0200 Subject: [PATCH] [manchineid] proper cleanup --- src/modules/machineid/main.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/modules/machineid/main.py b/src/modules/machineid/main.py index cb121600f..7966ad73b 100644 --- a/src/modules/machineid/main.py +++ b/src/modules/machineid/main.py @@ -34,19 +34,18 @@ def run(): enable_dbus = libcalamares.job.configuration["dbus"] enable_symlink = libcalamares.job.configuration["symlink"] target_systemd_machineid_file = "{}/etc/machine-id".format(root_mount_point) + target_dbus_machineid_file = "{}/var/lib/dbus/machine-id".format(root_mount_point) - if os.path.exists(target_systemd_machineid_file): - os.remove(target_systemd_machineid_file) - - if os.path.exists(target_dbus_machineid_file): - os.remove(target_dbus_machineid_file) + if enable_systemd or enable_dbus: + if os.path.exists(target_dbus_machineid_file): + os.remove(target_dbus_machineid_file) if enable_systemd: + if os.path.exists(target_systemd_machineid_file): + os.remove(target_systemd_machineid_file) check_target_env_call("systemd-machine-id-setup") if enable_dbus: - target_dbus_machineid_file = "{}/var/lib/dbus/machine-id".format(root_mount_point) - if enable_symlink and os.path.exists(target_systemd_machineid_file): check_target_env_call(["ln", "-s", "/etc/machine-id", "/var/lib/dbus/machine-id"]) else: