Commit fb488e4a authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis

Fix download of an existing file

Commit 41e4d5b5 introduced a bug that was triggered when downloading
an existing file. Fix this.
Signed-off-by: default avatarDimitris Aragiorgis <dimitris.aragiorgis@gmail.com>
parent 86fcbabe
......@@ -1381,11 +1381,17 @@ class file_download(_PithosContainer):
self.client.MAX_THREADS = int(self['max_threads'] or 5)
progress_bar = None
try:
# From _src_dst():
# If rpath is None output_file is a directory.
# If rpath is not None output_file is a file descriptor.
for rpath, output_file in self._src_dst(local_path):
if not rpath and not path.exists(output_file):
self.error('Create local directory %s' % output_file)
makedirs(output_file)
# Create a directory
if not rpath:
if not path.exists(output_file):
self.error('Create local directory %s' % output_file)
makedirs(output_file)
continue
# Download a file
self.error('/%s/%s --> %s' % (
self.container, rpath, output_file.name))
progress_bar, download_cb = self._safe_progress_bar(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment