diff --git a/lib/gems/pending/util/mount/miq_generic_mount_session.rb b/lib/gems/pending/util/mount/miq_generic_mount_session.rb index d7f7a27ee..b5bb8f81b 100644 --- a/lib/gems/pending/util/mount/miq_generic_mount_session.rb +++ b/lib/gems/pending/util/mount/miq_generic_mount_session.rb @@ -294,7 +294,7 @@ def download_single(remote_file, local_file) begin reconnect! - relpath = File.join(mnt_point, relative_to_mount(remote_file)) + relpath = uri_to_local_path(remote_file) unless File.exist?(relpath) logger.warn("#{log_header} Remote file: [#{remote_file}] does not exist!") return diff --git a/lib/gems/pending/util/mount/miq_local_mount_session.rb b/lib/gems/pending/util/mount/miq_local_mount_session.rb index 22ed2586e..0395e7c20 100644 --- a/lib/gems/pending/util/mount/miq_local_mount_session.rb +++ b/lib/gems/pending/util/mount/miq_local_mount_session.rb @@ -18,31 +18,11 @@ def disconnect; end # :nodoc: def mount_share; end # :nodoc: # rubocop:enable Style/SingleLineMethods, Layout/EmptyLineBetweenDefs - def relative_to_mount(dest_uri) # :nodoc: - dest_uri + def relative_to_mount(remote_file) # :nodoc: + remote_file end - def uri_to_local_path(dest_uri) # :nodoc: - File.expand_path(dest_uri) - end - - # :nodoc: - # - # This is an override to allow methods that make use of `@mnt_point` to - # behave as we would expect them to. - # - # Determine the mount point relative to the destination file, and just remove - # the portions of the expanded path that already exist in the - # `remote_file_path` (might be everything if `remote_file_path` is a absolute - # path) - def mnt_point - @mnt_point ||= begin - path_str = if remote_file_path.kind_of?(IO) - remote_file_path.path - else - remote_file_path.to_s - end - File.expand_path(path_str).sub(path_str, "") - end + def uri_to_local_path(remote_file) # :nodoc: + File.expand_path(remote_file) end end