From db2d1b38553df642598f715023ece341d6ef17e4 Mon Sep 17 00:00:00 2001
From: Abhijeet Kasurde <akasurde@redhat.com>
Date: Wed, 24 Aug 2016 12:42:37 +0530
Subject: [PATCH] Added install check before executing ipa-* command

Fixes: https://fedorahosted.org/freeipa/ticket/6261

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
---
 install/tools/ipa-managed-entries | 2 ++
 ipaserver/advise/base.py          | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/install/tools/ipa-managed-entries b/install/tools/ipa-managed-entries
index 8a89da8..efe6c69 100755
--- a/install/tools/ipa-managed-entries
+++ b/install/tools/ipa-managed-entries
@@ -31,6 +31,7 @@ from ipalib.constants import CACERT
 from ipapython.ipa_log_manager import root_logger, standard_logging_setup
 from ipapython.dn import DN
 
+
 def parse_options():
     usage = "%prog [options] <status|enable|disable>\n"
     usage += "%prog [options]\n"
@@ -74,6 +75,7 @@ def main():
     standard_logging_setup(None, debug=options.debug)
 
     host = installutils.get_fqdn()
+    installutils.check_server_configuration()
     api.bootstrap(context='cli', debug=options.debug)
     api.finalize()
 
diff --git a/ipaserver/advise/base.py b/ipaserver/advise/base.py
index a2dc9cc..0a2826a 100644
--- a/ipaserver/advise/base.py
+++ b/ipaserver/advise/base.py
@@ -27,6 +27,7 @@
 from ipalib.errors import ValidationError
 from ipapython import admintool
 from ipapython.ipa_log_manager import log_mgr
+from ipaserver.install import installutils
 
 
 """
@@ -235,6 +236,7 @@ def print_advice(self, keyword):
     def run(self):
         super(IpaAdvise, self).run()
 
+        installutils.check_server_configuration()
         api.bootstrap(in_server=False, context='cli')
         api.finalize()
         advise_api.bootstrap(in_server=False, context='cli')
