Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #45 from sensu/fix/server-fails-without-client-config
Browse files Browse the repository at this point in the history
Fix crash in sensu-server when client default settings are not present
  • Loading branch information
portertech authored Sep 7, 2016
2 parents 831b5db + 752b5fb commit 6d22bdd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/sensu/settings/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def load_directory(directory)
# * Ensuring client subscriptions include a single subscription based on the
# client name, e.g "client:i-424242".
def load_client_overrides
@settings[:client] ||= {}
@settings[:client][:subscriptions] ||= []
@settings[:client][:subscriptions] << "client:#{@settings[:client][:name]}"
@settings[:client][:subscriptions].uniq!
Expand All @@ -183,7 +184,7 @@ def load_client_overrides
# Load overrides, i.e. settings which should always be present.
# Examples include client settings overrides which ensure a per-client subscription.
def load_overrides!
load_client_overrides
load_client_overrides if ["client", "rspec"].include?(sensu_service_name)
end

# Set Sensu settings related environment variables. This method
Expand Down

0 comments on commit 6d22bdd

Please sign in to comment.