lib/scout/server.rb in scout-5.6.11 vs lib/scout/server.rb in scout-5.7.0.pre
- old
+ new
@@ -25,21 +25,22 @@
attr_reader :plugin_config
attr_reader :streamer_command
attr_reader :client_key
# Creates a new Scout Server connection.
- def initialize(server, client_key, history_file, logger = nil, server_name=nil, http_proxy='', https_proxy='', roles='', hostname = nil)
+ def initialize(server, client_key, history_file, logger=nil, server_name=nil, http_proxy='', https_proxy='', roles='', hostname=nil, environment='')
@server = server
@client_key = client_key
@history_file = history_file
@history = Hash.new
@logger = logger
@server_name = server_name
@http_proxy = http_proxy
@https_proxy = https_proxy
@roles = roles || ''
@hostname = hostname
+ @environment = environment
@plugin_plan = []
@plugins_with_signature_errors = []
@directives = {} # take_snapshots, interval, sleep_interval
@streamer_command = nil
@new_plan = false
@@ -58,10 +59,10 @@
end
def refresh?
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?roles=#{@roles}&hostname=#{URI.encode(@hostname)}")
+ url=URI.join( @server.sub("https://","http://"), "/clients/#{ping_key}/ping.scout?roles=#{@roles}&hostname=#{URI.encode(@hostname)}&env=#{URI.encode(@environment)}")
headers = {"x-scout-tty" => ($stdin.tty? ? 'true' : 'false')}
if @history["plan_last_modified"] and @history["old_plugins"]
headers["If-Modified-Since"] = @history["plan_last_modified"]
end