Skip to content

Commit

Permalink
Add support for notice file
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbASF committed Sep 24, 2024
1 parent 7685097 commit d1fc03d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/whimsy/asf/status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def self.testnode?
# - or testnode
def self.updates_disallowed_reason
return nil if testnode?
return 'Service temporarily unavailable due to migration.' if migrating?
return 'Service unavailable on this node. Please ensure you have logged in to the correct host.' unless active?
return 'Updates unavailable due to migration.' if migrating?
return 'Updates unavailable on this node. Please ensure you have logged in to the correct host.' unless active?

nil
end
Expand All @@ -73,6 +73,16 @@ def self.activeIP # intended for CLI testing
Resolv::DNS.open.getaddress(ACTIVE_HOSTNAME)
end

# return notice file header and href path or nil
def self.notice
path = '/srv/whimsy/www/notice.txt'
if File.exist? path
File.open(path) do |fh|
return fh.readline, '/notice.txt'
end
end
nil
end
end

# for debugging purposes
Expand Down

0 comments on commit d1fc03d

Please sign in to comment.