Sunday, June 19, 2016

[389-commits] Branch '389-ds-base-1.3.3' - ldap/admin

ldap/admin/src/scripts/repl-monitor.pl.in | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 62052f78a566390376bac31465a157484bf66e4a
Author: Mark Reynolds <mreynolds@redhat.com>
Date: Fri Jun 17 20:58:16 2016 -0400

Ticket 47538 - repl-monitor.pl not displaying correct color code for lag time

Bug Description: The tool was not correctly picking the correct
color code in the html report.

Fix Description: Correct the logic for picking the color. Also
found an issue where if the agmtmaxcsn contains
"unavailable" for the supplier maxcsn the tool
did not know how to properly handle it.

https://fedorahosted.org/389/ticket/47538

Reviewed by: nhosoi(Thanks!)

(cherry picked from commit 7ada2e2f1bdaab24f39d197b1569f9d418059534)

diff --git a/ldap/admin/src/scripts/repl-monitor.pl.in b/ldap/admin/src/scripts/repl-monitor.pl.in
index 3b1cf30..5354a8b 100755
--- a/ldap/admin/src/scripts/repl-monitor.pl.in
+++ b/ldap/admin/src/scripts/repl-monitor.pl.in
@@ -820,7 +820,7 @@ sub print_consumers

if ($c_ridx >= 0) {
$myruv = $allruvs {"$c_ridx:$mid"};
- ($c_maxcsn, $c_lastmodified) = split ( /;/, "$myruv" );
+ ($c_maxcsn, $c_lastmodified) = split ( /;/, $myruv );
($c_sidx, $c_replicaroot, $c_replicatype) = split (/:/, $allreplicas[$c_ridx]);
$c_replicaroot = "same as master" if $m_replicaroot eq $c_replicaroot;
}
@@ -859,7 +859,7 @@ sub print_consumers
$first_entry = 0;
$c_ldapurl = &get_ldap_url ($c_sidx, $conntype);
if ($c_ridx >= 0) {
- ($c_maxcsn_str, $lag, $markcolor, $supplier_maxcsn) =
+ ($c_maxcsn_str, $lag, $markcolor, $supplier_maxcsn) =
&cacl_time_lag ($_->{nsDS5ReplicaRoot},
$_->{cn},
$_->{nsds5ReplicaHost},
@@ -1209,7 +1209,7 @@ sub get_ldap_url
sub to_decimal_csn
{
my ($maxcsn) = @_;
- if (!$maxcsn || $maxcsn eq "") {
+ if (!$maxcsn || $maxcsn eq "" || $maxcsn eq "Unavailable") {
return "none";
}

@@ -1229,6 +1229,9 @@ sub to_string_csn
if (!$rawcsn || $rawcsn eq "") {
return "none";
}
+ if ($rawcsn eq "Unavailable"){
+ return $rawcsn;
+ }
my ($tm, $seq, $masterid, $subseq) = split(/ /, $decimalcsn);
my ($sec, $min, $hour, $mday, $mon, $year) = localtime($tm);
$mon++;
@@ -1249,8 +1252,9 @@ sub get_color
my ($color) = $allcolors { $colorkeys[0] };

foreach ( keys %allcolors) {
- last if ($lag_minute < $_);
- $color = $allcolors {$_};
+ if ($lag_minute >= $_){
+ $color = $allcolors {$_};
+ }
}
return $color;
}
@@ -1313,9 +1317,9 @@ sub print_html_header
print "Directory Server Replication Status ($version)\n\n";
print "Time: $now";
if ($opt_u) {
- print " - This report updates every $interval seconds\n\n";
+ print " - This report updates every $interval seconds\n\n";
} else {
- print "\n";
+ print "\n";
}
}
}

--
389-commits mailing list
389-commits@lists.fedoraproject.org
https://lists.fedoraproject.org/admin/lists/389-commits@lists.fedoraproject.org

No comments:

Post a Comment