Update to upstream 0.7

This commit is contained in:
Rob Crittenden 2020-11-03 14:42:38 -05:00
parent 947c6e3028
commit 7ff45812d8
7 changed files with 16 additions and 166 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
/freeipa-healthcheck-0.4.tar.gz
/freeipa-healthcheck-0.5.tar.gz
/freeipa-healthcheck-0.6.tar.gz
/freeipa-healthcheck-0.7.tar.gz

View File

@ -1,6 +1,6 @@
From 580baa41da29d72d1e518abf38c9045f08c6ff6e Mon Sep 17 00:00:00 2001
From ea9e00e47307b4ab81cc31c37796dd7b6a4c8785 Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten@redhat.com>
Date: Wed, 1 Jul 2020 14:36:22 -0400
Date: Thu, 29 Oct 2020 11:49:22 -0400
Subject: [PATCH] Remove ipaclustercheck
Not shipping it from upstream into Fedora just yet
@ -27,13 +27,13 @@ Not shipping it from upstream into Fedora just yet
delete mode 100644 tests/test_cluster_ruv.py
diff --git a/setup.py b/setup.py
index 6a8eac0..0eeb691 100644
index 2b519fc..c25b2d7 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from setuptools import find_packages, setup
setup(
name='ipahealthcheck',
version='0.6',
version='0.7',
- namespace_packages=['ipahealthcheck', 'ipaclustercheck'],
+ namespace_packages=['ipahealthcheck'],
package_dir={'': 'src'},
@ -515,7 +515,7 @@ index 0e51da9..0000000
- value='No dangling CS RUVs found')
diff --git a/tests/test_cluster_ruv.py b/tests/test_cluster_ruv.py
deleted file mode 100644
index d173a1a..0000000
index 7583c84..0000000
--- a/tests/test_cluster_ruv.py
+++ /dev/null
@@ -1,106 +0,0 @@
@ -533,7 +533,7 @@ index d173a1a..0000000
-import clusterdata
-
-
-class TestRegistry(ClusterRegistry):
-class RUVRegistry(ClusterRegistry):
- def load_files(self, dir):
- self.json = dir
-
@ -547,7 +547,7 @@ index d173a1a..0000000
- return self.data
-
-
-registry = TestRegistry()
-registry = RUVRegistry()
-
-
-class TestClusterRUV(BaseTest):

View File

@ -1,41 +0,0 @@
From f78a6c7297375b4721835bae2f33bf0ed34a0586 Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten@redhat.com>
Date: Wed, 15 Jul 2020 16:47:22 -0400
Subject: [PATCH] Don't collect the list of masters in MetaCheck
It is already collected in IPAMetaCheck.
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
---
src/ipahealthcheck/meta/core.py | 8 --------
1 file changed, 8 deletions(-)
diff --git a/src/ipahealthcheck/meta/core.py b/src/ipahealthcheck/meta/core.py
index 491a4f0..c021b79 100644
--- a/src/ipahealthcheck/meta/core.py
+++ b/src/ipahealthcheck/meta/core.py
@@ -7,21 +7,13 @@ from ipahealthcheck.core import constants
from ipahealthcheck.core.plugin import Result, duration
from ipahealthcheck.meta.plugin import Plugin, registry
from ipapython.version import VERSION, API_VERSION
-from ipapython.dn import DN
-from ipalib import api
@registry
class MetaCheck(Plugin):
@duration
def check(self):
- conn = api.Backend.ldap2
- masters_dn = DN(api.env.container_masters, api.env.basedn)
- masters = conn.get_entries(masters_dn, conn.SCOPE_ONELEVEL)
- known = [master.single_value['cn'] for master in masters]
-
yield Result(self, constants.SUCCESS,
fqdn=socket.getfqdn(),
- masters=known,
ipa_version=VERSION,
ipa_api_version=API_VERSION,)
--
2.25.4

View File

@ -1,29 +0,0 @@
From 4cb249430141fdc27d84ee796149a14b7e83afb5 Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten@redhat.com>
Date: Thu, 23 Jul 2020 17:07:43 -0400
Subject: [PATCH] Require that dirsrv be running to run the IPAMetaCheck
Without it we don't have an LDAP connection to collect the
list of servers.
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
---
src/ipahealthcheck/ipa/meta.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/ipahealthcheck/ipa/meta.py b/src/ipahealthcheck/ipa/meta.py
index caf27ea..e4ca323 100644
--- a/src/ipahealthcheck/ipa/meta.py
+++ b/src/ipahealthcheck/ipa/meta.py
@@ -11,6 +11,8 @@ from ipalib import api
@registry
class IPAMetaCheck(IPAPlugin):
"""Return meta data for the IPA installation"""
+ requires = ('dirsrv',)
+
@duration
def check(self):
try:
--
2.25.4

View File

@ -1,82 +0,0 @@
From e62e05a535f0a5126fdcee57348c6198801805bb Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten@redhat.com>
Date: Tue, 28 Jul 2020 17:51:23 -0400
Subject: [PATCH] Allow consuming projects to not use all available options
Some consumers of the framework may not be interested in the
filtering options. Don't fail if some or all of those are not
defined as options. Set logical defaults in this case.
https://github.com/freeipa/freeipa-healthcheck/issues/144
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
---
src/ipahealthcheck/core/output.py | 16 +++++++++++++---
tests/test_init.py | 28 ++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 3 deletions(-)
create mode 100644 tests/test_init.py
diff --git a/src/ipahealthcheck/core/output.py b/src/ipahealthcheck/core/output.py
index 6e7aed4..cfd0f94 100644
--- a/src/ipahealthcheck/core/output.py
+++ b/src/ipahealthcheck/core/output.py
@@ -37,9 +37,19 @@ class Output:
"""
def __init__(self, options):
self.filename = options.outfile
- self.failures_only = options.failures_only
- self.all = options.all
- self.severity = options.severity
+
+ # Non-required options in the framework, set logical defaults to
+ # pre 0.6 behavior with everything reported.
+ self.severity = None
+ self.failures_only = False
+ self.all = True
+
+ if 'failures_only' in options:
+ self.failures_only = options.failures_only
+ if 'all' in options:
+ self.all = options.all
+ if 'severity' in options:
+ self.severity = options.severity
def render(self, results):
"""Process the results into output"""
diff --git a/tests/test_init.py b/tests/test_init.py
new file mode 100644
index 0000000..e18e03c
--- /dev/null
+++ b/tests/test_init.py
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2020 FreeIPA Contributors see COPYING for license
+#
+
+import argparse
+
+from ipahealthcheck.core.output import output_registry
+
+
+class RunChecks:
+ def run_healthcheck(self):
+ options = argparse.Namespace(check=None, debug=False, indent=2,
+ list_sources=False, outfile=None,
+ output='json', source=None,
+ verbose=False)
+
+ for out in output_registry.plugins:
+ if out.__name__.lower() == options.output:
+ out(options)
+ break
+
+
+def test_run_healthcheck():
+ """
+ Test typical initialization in run_healthcheck (based ok pki-healthcheck)
+ """
+ run = RunChecks()
+ run.run_healthcheck()
--
2.25.4

View File

@ -8,8 +8,8 @@
Name: %{project}-%{shortname}
Version: 0.6
Release: 4%{?dist}
Version: 0.7
Release: 1%{?dist}
Summary: Health check tool for %{projectname}
BuildArch: noarch
License: GPLv3
@ -18,10 +18,8 @@ Source0: https://github.com/freeipa/freeipa-healthcheck/archive/%{version
Source1: %{longname}.conf
Patch0001: 0001-Remove-ipaclustercheck.patch
Patch0002: 0002-Don-t-collect-the-list-of-masters-in-MetaCheck.patch
Patch0003: 0003-Require-that-dirsrv-be-running-to-run-the-IPAMetaChe.patch
Patch0004: 0004-Allow-consuming-projects-to-not-use-all-available-op.patch
Requires: %{name}-core = %{version}-%{release}
Requires: %{project}-server
Requires: python3-ipalib
Requires: python3-ipaserver
@ -135,7 +133,10 @@ install -p -m644 %{_builddir}/%{project}-%{shortname}-%{version}/man/man5/%{long
%changelog
* Wed Jul 29 2020 Rob Crittenden <rcritten@redhat.com> - 0.6-4
* Thu Oct 29 2020 Rob Crittenden <rcritten@redhat.com> - 0.7-1
- Update to upstream 0.7
* Wed Jul 29 2020 Rob Crittenden <rcritten@redhat.com> - 0.6-3
- Set minimum Requires on python3-lib389
- Don't assume that all users of healthcheck-core provide the same
set of options.

View File

@ -1 +1 @@
SHA512 (freeipa-healthcheck-0.6.tar.gz) = 5f359ecb65f863a000ca1e302636f1fb46bb57c178088080c8e4006f3b4b88d87ed81e354c122d958bd3aec22e6ffde5f13d6be6f323ff1f93661064de0ac2ce
SHA512 (freeipa-healthcheck-0.7.tar.gz) = 9ec986c9bb8ff08b857101e9e319fcdb2afbcb4eb9e42e61afb138a6f2def39acef3c0aa83ce91dcf413798df0fdb37d7370da1b2672ca84e4e03bdd1f99dcf1