Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions isd_s3/isd_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def upload_object(self, local_file, key, metadata=None, bucket=None, md5=False,
return ret

def get_filelist(self, local_dir, recursive=False, ignore=[]):
"""Returns local filelist.
"""Returns local filelist as a list of (fullpath, localpath) pairs.

Args:
local_dir (str) [REQUIRED]: local directory to scan
Expand All @@ -380,7 +380,7 @@ def get_filelist(self, local_dir, recursive=False, ignore=[]):
ignore_cur_file=True
break
if not ignore_cur_file:
filelist.append(full_filename)
filelist.append((full_filename, _file))
if not recursive:
return filelist
return filelist
Expand Down Expand Up @@ -414,8 +414,8 @@ def upload_mult_objects(self, local_dir, key_prefix=None, bucket=None, recursive
if metadata is not None:
func = self._interpret_metadata_str(metadata)
cpus = multiprocessing.cpu_count()
for _file in filelist:
key = key_prefix + _file
for (_file, localPath) in filelist:
key = key_prefix + localPath

metadata_str = None
print(_file)
Expand All @@ -428,10 +428,10 @@ def upload_mult_objects(self, local_dir, key_prefix=None, bucket=None, recursive
try:
p = multiprocessing.Process(
target=self.upload_object,
args=(_file, key,metadata_str, bucket ))
args=(_file, key, metadata_str, bucket ))
p.start()
except:
self.upload_object(_file,key,metadata,bucket)
self.upload_object(_file, key, metadata, bucket)


def interpret_metadata_str(self, metadata):
Expand Down