Closed cwjohnston closed 8 years ago
I believe this may close #90 as well.
Let's clean up api_settings(), perhaps we should do something like https://gist.github.com/portertech/77ecd66f88925d163576c9da593a0013
@portertech I've updated the PR per your suggestion
@portertech ready again
Description
This change defaults the configuration for the API to
{ "host": "127.0.0.1", "port": 4567 }
when neither theSENSU_API_URL
environment variable is set nor anapi
configuration scope is defined in the loaded Sensu settings. Prior to this change, undefinedapi
host and port attributes would raise an exception when a plugin attempts to make requests against the Sensu API.Motivation and Context
This change is intended as a convenience for users running the API on same compute instance as their Sensu server (as is the behavior under Sensu Enterprise). Closes #95.
How Has This Been Tested?
Manually tested in local environment.
Types of changes
Checklist:
Known Caveats
With this change, configurations which previously reported the error "api.json settings not found" will now attempt to connect to the api on 127.0.0.1:4567. If the API is not listening on this ip and port combination, connection errors will bubble up from Net::HTTP instead. This will likely take longer than simply raising an exception.