Skip to content

Commit

Permalink
Loop through the registry twice in order to collect ca_configured
Browse files Browse the repository at this point in the history
Skipping the pki plugins was dependent upon the order the registry
was being processed. The assumption was that the ipa plugin would
be done first so ca_configured would be defined. If this isn't the
case the the pki plugins are incorrectly skipped. So run through
the list twice (it's short).

Signed-off-by: Rob Crittenden <[email protected]>

freeipa/freeipa-healthcheck#201
  • Loading branch information
joeldavidparker committed Feb 1, 2022
1 parent 69bb12b commit 4113841
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ipahealthcheck/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def run_healthcheck(self):
# which should set ca_configured in its registry to True or
# False. We will skip the pkihealthcheck plugins only if
# ca_configured is False which means that it was set by IPA.
ca_configured = None
ca_configured = False
for name, registry in find_registries(self.entry_points).items():
try:
registry.initialize(framework, config, options)
Expand All @@ -345,6 +345,7 @@ def run_healthcheck(self):
continue
if hasattr(registry, 'ca_configured'):
ca_configured = registry.ca_configured
for name, registry in find_registries(self.entry_points).items():
if 'pkihealthcheck' in name and ca_configured is False:
logger.debug('IPA CA is not configured, skipping %s', name)
continue
Expand Down

0 comments on commit 4113841

Please sign in to comment.