Skip to content

Commit

Permalink
LogFile#build_path_ftp is no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunne committed Jun 25, 2014
1 parent 2ebb487 commit 32df530
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions vmdb/app/models/log_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,35 +331,6 @@ def format_log_time(time)

private

def build_path_ftp(ftp, path)
current = nil
path.split("/").each do |p|
# Do not attempt to change to a blank directory
next if p.blank?
current = current.nil? ? p : [current, p].join("/")
begin
# Keep track of where we were before changing the directory
pwd = ftp.pwd
$log.info("Checking Directory: [#{current}] from [#{pwd}]")
ftp.chdir(current)
rescue Net::FTPPermError => err
# directory does not exist
rescue => err
raise "#{err.message}, changing to remote directory '#{current}' from '#{pwd}'" unless code.to_i == 550 # The system cannot find the path specified.
else
$log.info("Directory: [#{current}] exists")

# Change back to the original directory
ftp.chdir(pwd)
next # directory already exists
end

$log.info("Creating Directory: [#{current}] from [#{ftp.pwd}]")
ftp.mkdir(current)
end
current
end

def self._request_logs(options)
taskid = options[:taskid]
klass = options.delete(:klass).to_s
Expand Down

0 comments on commit 32df530

Please sign in to comment.