[services] proper DM check

This commit is contained in:
Philip 2016-10-15 09:41:10 +02:00
parent 9d18fb1ece
commit 87006eaa20

View File

@ -71,15 +71,16 @@ def run():
libcalamares.utils.debug("Cannot disable systemd service {}".format(dbl['name'])) libcalamares.utils.debug("Cannot disable systemd service {}".format(dbl['name']))
libcalamares.utils.debug("systemctl disable call in chroot returned error code {}".format(ec)) 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"): 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: if ec != 0:
return "Cannot enable systemd service {}".format(dm), \ return "Cannot enable systemd service {}".format(dm), \
"systemctl enable call in chroot returned error code {}".format(ec) "systemctl enable call in chroot returned error code {}".format(ec)
else: else:
libcalamares.utils.debug("Cannot enable systemd service {}".format(dm)) libcalamares.utils.debug("Cannot enable systemd service {}".format(dm))
libcalamares.utils.debug("systemctl enable call in chroot returned error code {}".format(ec)) libcalamares.utils.debug("systemctl enable call in chroot returned error code {}".format(ec))
return None return None