1 file changed, 5 insertions(+), 13 deletions(-)
New commits:
commit 14fcac3166a4925b080d7b3349f9664f42696588
Author: Mark Reynolds <mreynolds@redhat.com>
Date: Wed Jun 29 10:06:03 2016 -0400
Ticket 47538 - repl-monitor.pl legend not properly sorted
Description: Custom color codes/lowmarks were not properly sorted
and led to the HTML legend being out of order. Also,
made the "unknown" lag time color code consistent.
https://fedorahosted.org/389/ticket/47538
Reviewed by: nhosoi & viktor(Thanks!)
diff --git a/ldap/admin/src/scripts/repl-monitor.pl.in b/ldap/admin/src/scripts/repl-monitor.pl.in
index 248cf8b..aa7ab1e 100755
--- a/ldap/admin/src/scripts/repl-monitor.pl.in
+++ b/ldap/admin/src/scripts/repl-monitor.pl.in
@@ -364,7 +364,7 @@ sub read_cfg_file
$allcolors {5} = "#ffffcc"; #cream yellow
$allcolors {60} = "#ffcccc"; #pale pink
}
- @colorkeys = sort (keys (%allcolors));
+ @colorkeys = sort ({ $a <=> $b } keys (%allcolors));
return 0;
}
@@ -968,18 +968,10 @@ sub cacl_time_lag
$supplier_csn_str = &to_string_csn ($s_maxcsn);
$csn_str = &to_string_csn ($c_maxcsn);
- if ((!$s_maxcsn || $s_maxcsn eq "Unavailable") &&
- (!$c_maxcsn || $c_maxcsn eq "Unavailable")) {
+ if (!$s_maxcsn || $s_maxcsn eq "Unavailable" ||
+ !$c_maxcsn || $c_maxcsn eq "Unavailable") {
$lag_str = "?:??:??";
- $markcolor = "white"; # Both unknown
- }
- elsif ($s_maxcsn && (!$c_maxcsn || $c_maxcsn eq "Unavailable")) {
- $lag_str = "- ?:??:??";
- $markcolor = &get_color (36000); # assume consumer has big latency
- }
- elsif ((!$s_maxcsn || $s_maxcsn eq "Unavailable") && $c_maxcsn) {
- $lag_str = "+ ?:??:??";
- $markcolor = &get_color (1); # consumer is ahead of supplier
+ $markcolor = "white"; # True status unknown
}
elsif ($s_maxcsn le $c_maxcsn) {
$lag_str = "0:00:00";
@@ -1232,7 +1224,7 @@ sub get_color
$lag_minute /= 60;
my ($color) = $allcolors { $colorkeys[0] };
- foreach ( sort keys %allcolors) {
+ foreach ( sort { $a <=> $b } keys %allcolors) {
if ($lag_minute >= $_){
$color = $allcolors {$_};
}
--
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