From acd807b6e054b06b7b6fafe86741e00bae7d2527 Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcritten@redhat.com>
Date: Tue, 30 Jul 2019 17:25:30 -0400
Subject: [PATCH] Change DNA no range from SUCCESS to WARNING
Elevate the not set version to WARNING so admins can be aware in
advance that with no range then uid/gid cannot be allocated from
this master. This is particularly important if the only master with
a range defined is retired.
https://github.com/freeipa/freeipa-healthcheck/issues/60
---
src/ipahealthcheck/ipa/dna.py | 6 ++++--
tests/test_ipa_dna.py | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/ipahealthcheck/ipa/dna.py b/src/ipahealthcheck/ipa/dna.py
index 9dd2ffa..4d85057 100644
--- a/src/ipahealthcheck/ipa/dna.py
+++ b/src/ipahealthcheck/ipa/dna.py
@@ -41,9 +41,11 @@ class IPADNARangeCheck(IPAPlugin):
next_start=next_start or 0,
next_max=next_max or 0)
else:
- yield Result(self, constants.SUCCESS,
+ yield Result(self, constants.WARNING,
range_start=0,
range_max=0,
next_start=0,
next_max=0,
- msg='No range defined')
+ msg='No DNA range defined. If no masters define a '
+ 'range then users and groups cannot be '
+ 'created.')
diff --git a/tests/test_ipa_dna.py b/tests/test_ipa_dna.py
index 0ff7dd4..3d5dd3e 100644
--- a/tests/test_ipa_dna.py
+++ b/tests/test_ipa_dna.py
@@ -66,7 +66,7 @@ class TestDNARange(BaseTest):
assert len(self.results) == 1
result = self.results.results[0]
- assert result.result == constants.SUCCESS
+ assert result.result == constants.WARNING
assert result.source == 'ipahealthcheck.ipa.dna'
assert result.check == 'IPADNARangeCheck'
assert result.kw.get('range_start') == 0
--
2.20.1