lib/appstats/log_collector.rb in appstats-0.13.2 vs lib/appstats/log_collector.rb in appstats-0.13.3
- old
+ new
@@ -169,9 +169,15 @@
count = 0
Appstats.log(:info,"About to remove #{all.size} remote file(s) from the processing queue.")
all.each do |log_collector|
host = log_collector.host
+
+ if normalized_logins[host].nil?
+ Appstats.log(:info," - Missing host login details [#{host}], unable to remove #{log_collector.processed_filename}")
+ next
+ end
+
user = normalized_logins[host][:user]
password = normalized_logins[host][:password]
Net::SSH.start(host, user, :password => password ) do |ssh|
ssh.exec!("mv #{log_collector.filename} #{log_collector.processed_filename}")
\ No newline at end of file