Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixups for skipping the pki healthchecks #243

Merged
merged 2 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ipahealthcheck/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,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 @@ -320,6 +320,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
6 changes: 3 additions & 3 deletions src/ipahealthcheck/ipa/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def initialize(self, framework, config, options=None):
logger.debug('Failed to connect to LDAP: %s', e)
return

ca = cainstance.CAInstance(api.env.realm, host_name=api.env.host)
self.ca_configured = ca.is_configured()

# This package is pulled in when the trust package is installed
# and is required to lookup trust users. If this is not installed
# then it can be inferred that trust is not enabled.
Expand All @@ -85,8 +88,5 @@ def initialize(self, framework, config, options=None):
if role.get('status') == 'enabled':
self.trust_controller = True

ca = cainstance.CAInstance(api.env.realm, host_name=api.env.host)
self.ca_configured = ca.is_configured()


registry = IPARegistry()