-
-
Save portertech/77ecd66f88925d163576c9da593a0013 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def api_settings | |
case | |
when ENV['SENSU_API_URL'] | |
uri = URI(ENV['SENSU_API_URL']) | |
@api_settings = { | |
'host' => uri.host, | |
'port' => uri.port, | |
'user' => uri.user, | |
'password' => uri.password | |
} | |
else | |
@api_settings = settings['api'] || {} | |
@api_settings['host'] ||= '127.0.0.1' | |
@api_settings['port'] ||= 4567 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment