This is an automated email from the ASF dual-hosted git repository.
sebb 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 095a7f6 Use new Status module to centralise checks
095a7f6 is described below
commit 095a7f6a381057b1a4449d46c41455dbc21cd852
Author: Sebb <[email protected]>
AuthorDate: Wed Sep 23 16:49:02 2020 +0100
Use new Status module to centralise checks
---
www/board/agenda/routes.rb | 10 ++--------
www/secretary/workbench/server.rb | 11 ++---------
2 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/www/board/agenda/routes.rb b/www/board/agenda/routes.rb
index ec862b5..69018b4 100755
--- a/www/board/agenda/routes.rb
+++ b/www/board/agenda/routes.rb
@@ -2,14 +2,8 @@
# Server side Sinatra routes
#
-require_relative '../../whimsy'
-if Whimsy.master?
- UNAVAILABLE = nil # updates allowed
-else
- # disable all update actions
- # UNAVAILABLE = 'Service temporarily unavailable due to migration.'
- UNAVAILABLE = 'Service unavailable on this node. Please ensure you have
logged in to the correct host.'
-end
+require 'whimsy/asf/status'
+UNAVAILABLE = Status.updates_disallowed_reason # are updates disallowed?
# redirect root to latest agenda
get '/' do
diff --git a/www/secretary/workbench/server.rb
b/www/secretary/workbench/server.rb
index 48cab15..6fc618a 100644
--- a/www/secretary/workbench/server.rb
+++ b/www/secretary/workbench/server.rb
@@ -52,15 +52,8 @@ set :show_exceptions, true
disable :logging # suppress log of requests to stderr/error.log
-require_relative '../../whimsy'
-if Whimsy.master?
- UNAVAILABLE = nil # updates allowed
-else
- # disable all update actions
- # UNAVAILABLE = 'Service temporarily unavailable due to migration.'
- UNAVAILABLE = 'Service unavailable on this node. Please ensure you have
logged in to the correct host.'
-end
-
+require 'whimsy/asf/status'
+UNAVAILABLE = Status.updates_disallowed_reason # are updates disallowed?
# list of messages
get '/' do