1 file changed, 11 insertions(+), 7 deletions(-)
New commits:
commit 769b1b2e0be4dfd19161fdafb16bb813426dd675
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 a670610..eca3db0 100755
--- a/ldap/admin/src/scripts/repl-monitor.pl.in
+++ b/ldap/admin/src/scripts/repl-monitor.pl.in
@@ -791,7 +791,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;
}
@@ -830,7 +830,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},
@@ -1180,7 +1180,7 @@ sub get_ldap_url
sub to_decimal_csn
{
my ($maxcsn) = @_;
- if (!$maxcsn || $maxcsn eq "") {
+ if (!$maxcsn || $maxcsn eq "" || $maxcsn eq "Unavailable") {
return "none";
}
@@ -1200,6 +1200,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++;
@@ -1220,8 +1223,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;
}
@@ -1284,9 +1288,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