URL: https://github.com/freeipa/freeipa/pull/114
Author: pspacek
 Title: #114: Raise errors from service.py:_ldap_mod() by default
Action: opened

PR body:
"""
This is to prevent situations when installer prints
CRITICAL Failed to load ....ldif
and continues just to crash later on because of non-existing LDAP container
or so on.

Beginning of devel cycle is the right time to fix this so we have time to 
uncover potential regressions and fix long hidden bugs.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/114/head:pr114
git checkout pr114
From a19729603deee5a5b015cd82fb060ac814812120 Mon Sep 17 00:00:00 2001
From: Petr Spacek <pspa...@redhat.com>
Date: Tue, 26 Apr 2016 19:42:00 +0200
Subject: [PATCH] Raise errors from service.py:_ldap_mod() by default

This is to prevent situations when installer prints
CRITICAL Failed to load ....ldif
and continues just to crash later on because of non-existing LDAP container
or so on.
---
 ipaserver/install/service.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ipaserver/install/service.py b/ipaserver/install/service.py
index 057cd3d..88332aa 100644
--- a/ipaserver/install/service.py
+++ b/ipaserver/install/service.py
@@ -185,7 +185,7 @@ def ldap_disconnect(self):
         self.admin_conn.unbind()
         self.admin_conn = None
 
-    def _ldap_mod(self, ldif, sub_dict=None, raise_on_err=False):
+    def _ldap_mod(self, ldif, sub_dict=None, raise_on_err=True):
         pw_name = None
         fd = None
         path = ipautil.SHARE_DIR + ldif
@@ -229,9 +229,9 @@ def _ldap_mod(self, ldif, sub_dict=None, raise_on_err=False):
             try:
                 ipautil.run(args, nolog=nologlist)
             except ipautil.CalledProcessError as e:
+                root_logger.critical("Failed to load %s: %s" % (ldif, str(e)))
                 if raise_on_err:
                     raise
-                root_logger.critical("Failed to load %s: %s" % (ldif, str(e)))
         finally:
             if pw_name:
                 os.remove(pw_name)
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to