Friday, May 31, 2019

[389-commits] [389-ds-base] branch 389-ds-base-1.3.9 updated: Ticket 50413 - ds-replcheck - Always display the Result Summary

This is an automated email from the git hooks/post-receive script.

mreynolds pushed a commit to branch 389-ds-base-1.3.9
in repository 389-ds-base.

The following commit(s) were added to refs/heads/389-ds-base-1.3.9 by this push:
new 1b3c075 Ticket 50413 - ds-replcheck - Always display the Result Summary
1b3c075 is described below

commit 1b3c075bbdc6374156330b7b918accaa5d5bf42b
Author: Mark Reynolds <mreynolds@redhat.com>
AuthorDate: Thu May 30 15:38:27 2019 -0400

Ticket 50413 - ds-replcheck - Always display the Result Summary

Description: Previously we only printed a "Result Summary" if there
were no inconsistencies and the entry counts matched.
However, the entry counts do not need to match. So
this made the "Result Summary" checks too strict, and
if things were out of sync there was no Result Summary
printed at all. This fix just always prints a result
summary and it removes the entry count check.

https://pagure.io/389-ds-base/issue/50413

Reviewed by: ?

(cherry picked from commit 423a7ba01ed3bad52c8caa6a20267f2335b3c69f)
---
ldap/admin/src/scripts/ds-replcheck | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/ldap/admin/src/scripts/ds-replcheck b/ldap/admin/src/scripts/ds-replcheck
index a9411cb..aea32fd 100755
--- a/ldap/admin/src/scripts/ds-replcheck
+++ b/ldap/admin/src/scripts/ds-replcheck
@@ -581,14 +581,14 @@ def do_offline_report(opts, output_file=None):
MLDIF = open(opts['mldif'], "r")
except Exception as e:
print('Failed to open Master LDIF: ' + str(e))
- return None
+ return

try:
RLDIF = open(opts['rldif'], "r")
except Exception as e:
print('Failed to open Replica LDIF: ' + str(e))
MLDIF.close()
- return None
+ return

# Verify LDIF Files
try:
@@ -598,7 +598,7 @@ def do_offline_report(opts, output_file=None):
print('Master LDIF file in invalid, aborting...')
MLDIF.close()
RLDIF.close()
- return None
+ return
try:
print("Validating Replica ldif file ({})...".format(opts['rldif']))
LDIFRecordList(RLDIF).parse()
@@ -606,7 +606,7 @@ def do_offline_report(opts, output_file=None):
print('Replica LDIF file is invalid, aborting...')
MLDIF.close()
RLDIF.close()
- return None
+ return

# Get all the dn's, and entry counts
print ("Gathering all the DN's...")
@@ -758,10 +758,13 @@ def do_offline_report(opts, output_file=None):
final_report += ('=====================================================\n\n')
for diff in diff_report:
final_report += ('%s\n' % (diff))
- if missing_report == "" and len(diff_report) == 0 and m_count == r_count:
- final_report += ('\nResult\n')
- final_report += ('=====================================================\n\n')
- final_report += ('No differences between Master and Replica\n')
+
+ final_report += ('\nResult\n')
+ final_report += ('=====================================================\n\n')
+ if missing_report == "" and len(diff_report) == 0:
+ final_report += ('No replication differences between Master and Replica\n')
+ else:
+ final_report += ('There are replication differences between Master and Replica\n')

if output_file:
output_file.write(final_report)
@@ -1009,10 +1012,12 @@ def print_online_report(report, opts, output_file):
for diff in report['diff']:
final_report += ('%s\n' % (diff))

- if not missing and len(report['diff']) == 0 and report['m_count'] == report['r_count']:
- final_report += ('\nResult\n')
- final_report += ('=====================================================\n\n')
- final_report += ('No differences between Master and Replica\n')
+ final_report += ('\nResult\n')
+ final_report += ('=====================================================\n\n')
+ if not missing and len(report['diff']) == 0:
+ final_report += ('No replication differences between Master and Replica\n')
+ else:
+ final_report += ('There are replication differences between Master and Replica\n')

if output_file:
output_file.write(final_report)

--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
389-commits mailing list -- 389-commits@lists.fedoraproject.org
To unsubscribe send an email to 389-commits-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/389-commits@lists.fedoraproject.org

No comments:

Post a Comment