summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimotheus Pokorra <tp@tbits.net>2015-02-12 16:30:53 +0100
committerTimotheus Pokorra <timotheus.pokorra@solidcharity.com>2015-02-13 12:09:14 +0100
commit86a54625c8149ef51c9f62a4675acd5242d8b387 (patch)
tree80adbb6eead96aa271106b726d8d2e112aabd73d
parente1e49910f6c39c40de08c3c5b4650d76bcd87df6 (diff)
downloadpykolab-86a54625c8149ef51c9f62a4675acd5242d8b387.tar.gz
show meaningful error message if dirsrv-admin.service does not exist fixes #4554
-rw-r--r--pykolab/setup/setup_ldap.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pykolab/setup/setup_ldap.py b/pykolab/setup/setup_ldap.py
index 04311d2..c805d20 100644
--- a/pykolab/setup/setup_ldap.py
+++ b/pykolab/setup/setup_ldap.py
@@ -670,7 +670,10 @@ ServerAdminPwd = %(admin_pass)s
auth._auth.ldap.modify_s(dn, modlist)
if os.path.isfile('/bin/systemctl'):
- subprocess.call(['/bin/systemctl', 'enable', 'dirsrv-admin.service'])
+ if not os.path.isfile('/usr/lib/systemd/system/dirsrv-admin.service'):
+ log.info(_("directory server admin service not available"))
+ else:
+ subprocess.call(['/bin/systemctl', 'enable', 'dirsrv-admin.service'])
elif os.path.isfile('/sbin/chkconfig'):
subprocess.call(['/sbin/chkconfig', 'dirsrv-admin', 'on'])
elif os.path.isfile('/usr/sbin/update-rc.d'):