lib/scout/server.rb in scout-5.6.6 vs lib/scout/server.rb in scout-5.6.7.pre
- old
+ new
@@ -25,21 +25,21 @@
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='', fqdn = nil)
+ def initialize(server, client_key, history_file, logger = nil, server_name=nil, http_proxy='', https_proxy='', roles='', hostname = nil)
@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 || ''
- @fqdn = fqdn
+ @hostname = hostname
@plugin_plan = []
@plugins_with_signature_errors = []
@directives = {} # take_snapshots, interval, sleep_interval
@streamer_command = nil
@new_plan = false
@@ -47,11 +47,10 @@
@plugin_config_path = File.join(@local_plugin_path, "plugins.properties")
@account_public_key_path = File.join(@local_plugin_path, "scout_rsa.pub")
@history_tmp_file = history_file+'.tmp'
@plugin_config = load_plugin_configs(@plugin_config_path)
@data_file = Scout::DataFile.new(@history_file,@logger)
-
# the block is only passed for install and test, since we split plan retrieval outside the lockfile for run
if block_given?
load_history
yield self
save_history
@@ -59,10 +58,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}&fqdn=#{URI.encode(@fqdn)}")
+ url=URI.join( @server.sub("https://","http://"), "/clients/#{ping_key}/ping.scout?roles=#{@roles}&hostname=#{URI.encode(@hostname)}")
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