Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Check dashboard config for API host and prot. #69

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/sensu-dashboard/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def self.setup(options={})
unless $settings[:dashboard][:user].is_a?(String) && $settings[:dashboard][:password].is_a?(String)
raise('dashboard must have a user and password')
end
unless $settings[:api][:host].is_a?(String) && !$settings[:api][:port].to_i.zero?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it just use "$settings[:api][:port].is_a?(Integer)"? Since this is the validation the API does.

raise('dashboard must have an api host and api port')
end
$api_url = 'http://' + $settings[:api][:host] + ':' + $settings[:api][:port].to_s
$api_options = {}
if $settings[:api][:user] && $settings[:api][:password]
Expand Down