lib/scout/command.rb in scout-5.6.6 vs lib/scout/command.rb in scout-5.6.7.pre
- old
+ new
@@ -85,13 +85,13 @@
opts.on("--https-proxy URL", String,
"Optional https proxy for SSL traffic." ) do |https_proxy|
options[:https_proxy] = https_proxy
end
- opts.on("--fqdn FQDN", String,
- "Optional fully qualified domain name override." ) do |fqdn|
- options[:fqdn] = fqdn
+ opts.on("--hostname HOSTNAME", String,
+ "Optionally override the hostname." ) do |hostname|
+ options[:hostname] = hostname
end
opts.separator " "
opts.separator "Common Options:"
opts.separator "--------------------------------------------------------------------------"
@@ -175,12 +175,11 @@
@level = options[:level] || "info"
@force = options[:force] || false
@server_name = options[:server_name]
@http_proxy = options[:http_proxy] || ""
@https_proxy = options[:https_proxy] || ""
- @fqdn = (options[:fqdn] || `hostname -f`).chomp
-
+ @hostname = options[:hostname] || Socket.gethostname
@options = options
@args = args
# create config dir if necessary
@config_dir = File.dirname(history)
@@ -188,10 +187,10 @@
@log_path = File.join(@config_dir, "latest_run.log")
end
- attr_reader :server, :history, :config_dir, :log_path, :server_name, :fqdn
+ attr_reader :server, :history, :config_dir, :log_path, :server_name, :hostname
def verbose?
@verbose
end