Blame SOURCES/0028-Restore-the-log-level-after-loading-the-resources.patch

ec7001
commit b0b782da304babcff3ef64374c79bc879cbdc303
ec7001
Author: Rob Crittenden <rcritten@redhat.com>
ec7001
Date:   Wed May 5 16:30:43 2021 -0400
ec7001
ec7001
    Restore the log level after loading the resources
ec7001
    
ec7001
    It seems that loading the resources can affect the log level so
ec7001
    save it off before loading them and then restore it.
ec7001
    
ec7001
    I'm not entirely sure what is happening but this is an easy fix
ec7001
    and we can address it further later if we want.
ec7001
    
ec7001
    Signed-off-by: Rob Crittenden <rcritten@redhat.com>
ec7001
ec7001
diff --git a/src/ipahealthcheck/core/core.py b/src/ipahealthcheck/core/core.p
ec7001
y
ec7001
index 4ba94be..2d00586 100644
ec7001
--- a/src/ipahealthcheck/core/core.py
ec7001
+++ b/src/ipahealthcheck/core/core.py
ec7001
@@ -21,12 +21,15 @@ logger = logging.getLogger()
ec7001
 
ec7001
 
ec7001
 def find_registries(entry_points):
ec7001
+    # Loading the resources may reset the log level, save it.
ec7001
+    log_level = logger.level
ec7001
     registries = {}
ec7001
     for entry_point in entry_points:
ec7001
         registries.update({
ec7001
             ep.name: ep.resolve()
ec7001
             for ep in pkg_resources.iter_entry_points(entry_point)
ec7001
         })
ec7001
+    logger.setLevel(log_level)
ec7001
     return registries