Skip to content

Commit 0e138ed

Browse files
committed
For S3 in US Standard use Northern Virginia endpoint only.
1 parent 2fc4b82 commit 0e138ed

File tree

1 file changed

+31
-32
lines changed

1 file changed

+31
-32
lines changed

yas3fs

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -144,38 +144,37 @@ class FSData():
144144
stores = [ 'mem', 'disk' ]
145145
unknown_store = "Unknown store"
146146
def __init__(self, cache, store, path):
147-
with self.get_lock():
148-
self.cache = cache
149-
self.store = store
150-
self.path = path
151-
self.props = {}
152-
self.size = 0
153-
self.etag = None # Something better ???
154-
if store == 'mem':
155-
self.content = io.BytesIO()
156-
elif store == 'disk':
157-
previous_file = False
158-
filename = self.cache.get_cache_filename(self.path)
159-
if os.path.isfile(filename):
160-
# There's a file already there
161-
self.content = io.FileIO(filename, mode='rb+')
162-
self.update_size()
163-
self.content.close()
164-
self.set('new', None) # Not sure it is the latest version
165-
# Now search for an etag file
166-
etag_filename = self.cache.get_cache_etags_filename(self.path)
167-
if os.path.isfile(etag_filename):
168-
with open(etag_filename, 'r') as etag_file:
169-
self.etag = etag_file.read()
170-
previous_file = True
171-
if not previous_file:
172-
createDirForFile(filename)
173-
logger.debug("creating new cache file '%s'" % filename)
174-
open(filename, 'w').close() # To create an empty file (and overwrite a previous file)
175-
logger.debug("created new cache file '%s'" % filename)
176-
self.content = None # Not open, yet
177-
else:
178-
raise FSData.unknown_store
147+
self.cache = cache
148+
self.store = store
149+
self.path = path
150+
self.props = {}
151+
self.size = 0
152+
self.etag = None # Something better ???
153+
if store == 'mem':
154+
self.content = io.BytesIO()
155+
elif store == 'disk':
156+
previous_file = False
157+
filename = self.cache.get_cache_filename(self.path)
158+
if os.path.isfile(filename):
159+
# There's a file already there
160+
self.content = io.FileIO(filename, mode='rb+')
161+
self.update_size()
162+
self.content.close()
163+
self.set('new', None) # Not sure it is the latest version
164+
# Now search for an etag file
165+
etag_filename = self.cache.get_cache_etags_filename(self.path)
166+
if os.path.isfile(etag_filename):
167+
with open(etag_filename, 'r') as etag_file:
168+
self.etag = etag_file.read()
169+
previous_file = True
170+
if not previous_file:
171+
createDirForFile(filename)
172+
logger.debug("creating new cache file '%s'" % filename)
173+
open(filename, 'w').close() # To create an empty file (and overwrite a previous file)
174+
logger.debug("created new cache file '%s'" % filename)
175+
self.content = None # Not open, yet
176+
else:
177+
raise FSData.unknown_store
179178
def get_lock(self):
180179
return self.cache.get_lock(self.path)
181180
def open(self):

0 commit comments

Comments
 (0)