lib/scout/server.rb in scout-5.6.0.alpha.2 vs lib/scout/server.rb in scout-5.6.0.alpha.3
- old
+ new
@@ -34,11 +34,11 @@
@history = Hash.new
@logger = logger
@server_name = server_name
@http_proxy = http_proxy
@https_proxy = https_proxy
- @roles = roles
+ @roles = roles || ''
@plugin_plan = []
@plugins_with_signature_errors = []
@directives = {} # take_snapshots, interval, sleep_interval
@streamer_command = nil
@new_plan = false
@@ -61,10 +61,11 @@
return true if !ping_key or account_public_key_changed? # fetch the plan again if the account key is modified/created
url=URI.join( @server.sub("https://","http://"), "/clients/#{ping_key}/ping.scout")
headers = {"x-scout-tty" => ($stdin.tty? ? 'true' : 'false')}
+ headers["x-scout-roles"] = @roles
if @history["plan_last_modified"] and @history["old_plugins"]
headers["If-Modified-Since"] = @history["plan_last_modified"]
end
get(url, "Could not ping #{url} for refresh info", headers) do |res|
@streamer_command = res["x-streamer-command"] # usually will be nil, but can be [start,abcd,1234,5678|stop]
@@ -89,10 +90,10 @@
if refresh?
url = urlify(:plan)
info "Fetching plan from server at #{url}..."
headers = {"x-scout-tty" => ($stdin.tty? ? 'true' : 'false')}
- headers["x-scout-roles"] = @roles || ""
+ headers["x-scout-roles"] = @roles
get(url, "Could not retrieve plan from server.", headers) do |res|
begin
body = res.body
if res["Content-Encoding"] == "gzip" and body and not body.empty?