You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2017/08/02 01:31:05 UTC
[whimsy] branch master updated: adjust formatting
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new a1c28c6 adjust formatting
a1c28c6 is described below
commit a1c28c65f7bf6d7936096b6ddeaa443b284c4a65
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Tue Aug 1 21:30:53 2017 -0400
adjust formatting
---
www/status/monitors/system.rb | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/www/status/monitors/system.rb b/www/status/monitors/system.rb
index 9da76f4..f31459d 100644
--- a/www/status/monitors/system.rb
+++ b/www/status/monitors/system.rb
@@ -17,7 +17,7 @@ def Monitor.system(previous_status)
ENV['LANG'] = 'en_US.UTF-8'
ENV['LANGUAGE'] = 'en_US.UTF-8'
- puppet = `service puppet status`.force_encoding('utf-8').strip
+ puppet = `service puppet status`.force_encoding('utf-8').strip.split("\n")
if puppet.include? 'Active: active (running)'
status[name].merge! level: 'success', data: puppet
@@ -59,10 +59,13 @@ def Monitor.system(previous_status)
name = :ldap
pls = ASF::LDAP.puppet_ldapservers.sort
hosts = ASF::LDAP::HOSTS.sort
- diff = (pls-hosts).map {|host| "+#{host}"}
- diff += (hosts-pls).map {|host| "-#{host}"}
- status[name] = {level: diff.empty? ? 'success' : 'warning',
- data: diff.join(' ')}
+ diff = (pls-hosts).map {|host| "+ #{host}"}
+ diff += (hosts-pls).map {|host| "- #{host}"}
+ if diff.empty?
+ status[name] = {level: 'success', data: hosts}
+ else
+ status[name] = {level: 'warning', data: diff}
+ end
{data: status}
end
--
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].