Skip to content

Commit 57c5e2d

Browse files
committed
important bugfix for s3fs (binary pickles)
1 parent b09a9d0 commit 57c5e2d

File tree

1 file changed

+4
-2
lines changed
  • hubblestack/extmods/fileserver

1 file changed

+4
-2
lines changed

hubblestack/extmods/fileserver/s3fs.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ def _parse_env(environments, bucket_name, files):
553553

554554
log.debug('Writing buckets cache file')
555555

556-
with salt.utils.files.fopen(cache_file, 'w') as fp_:
556+
with salt.utils.files.fopen(cache_file, 'wb') as fp_:
557557
pickle.dump(metadata, fp_)
558558

559559
return metadata
@@ -569,7 +569,9 @@ def _read_buckets_cache_file(cache_file):
569569
try:
570570
data = pickle.load(fp_)
571571
except (pickle.UnpicklingError, AttributeError, EOFError, ImportError,
572-
IndexError, KeyError):
572+
IndexError, KeyError) as e:
573+
log.info('error unpickling buckets cache file (%s): %s',
574+
cache_file, repr(e))
573575
data = None
574576

575577
return data

0 commit comments

Comments
 (0)