From 31776755b47f44f894e4f2bb256aca1c5262b8a8 Mon Sep 17 00:00:00 2001 From: Martin Babinsky Date: Tue, 18 Aug 2015 12:47:46 +0200 Subject: [PATCH] ipa-restore: check whether DS is running before attempting connection https://fedorahosted.org/freeipa/ticket/4838 Reviewed-By: Alexander Bokovoy --- ipaserver/install/ipa_restore.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ipaserver/install/ipa_restore.py b/ipaserver/install/ipa_restore.py index 65cb49355..b69ea9000 100644 --- a/ipaserver/install/ipa_restore.py +++ b/ipaserver/install/ipa_restore.py @@ -410,6 +410,13 @@ class Restore(admintool.AdminTool): ''' Create an ldapi connection and bind to it using autobind as root. ''' + instance_name = installutils.realm_to_serverid(api.env.realm) + + if not services.knownservices.dirsrv.is_running(instance_name): + raise admintool.ScriptError( + "directory server instance is not running/configured" + ) + if self._conn is not None: return self._conn