From 87006eaa20735b01a1c141c892368d1a5f36d0ab Mon Sep 17 00:00:00 2001 From: Philip Date: Sat, 15 Oct 2016 09:41:10 +0200 Subject: [PATCH] [services] proper DM check --- src/modules/services/main.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/modules/services/main.py b/src/modules/services/main.py index 906a72c4c..55c720c3f 100644 --- a/src/modules/services/main.py +++ b/src/modules/services/main.py @@ -71,15 +71,16 @@ def run(): libcalamares.utils.debug("Cannot disable systemd service {}".format(dbl['name'])) libcalamares.utils.debug("systemctl disable call in chroot returned error code {}".format(ec)) - if libcalamares.globalstorage.contains("displayManagers") and not exists(join(rootmnt, "etc/systemd/system/display-manager.service")): + if libcalamares.globalstorage.contains("displayManagers"): for dm in libcalamares.globalstorage.value("displayManagers"): - ec = libcalamares.utils.target_env_call(['systemctl', 'enable', '{}.service'.format(dm)]) + if not exists(join(rootmnt, "etc/systemd/system/display-manager.service")): + ec = libcalamares.utils.target_env_call(['systemctl', 'enable', '{}.service'.format(dm)]) - if ec != 0: - return "Cannot enable systemd service {}".format(dm), \ - "systemctl enable call in chroot returned error code {}".format(ec) - else: - libcalamares.utils.debug("Cannot enable systemd service {}".format(dm)) - libcalamares.utils.debug("systemctl enable call in chroot returned error code {}".format(ec)) + if ec != 0: + return "Cannot enable systemd service {}".format(dm), \ + "systemctl enable call in chroot returned error code {}".format(ec) + else: + libcalamares.utils.debug("Cannot enable systemd service {}".format(dm)) + libcalamares.utils.debug("systemctl enable call in chroot returned error code {}".format(ec)) return None