Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
bd63700f
Commit
bd63700f
authored
Mar 09, 2009
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
S3FS: use get_bucket rather than create_bucket until we know the bucket doesn't exist.
parent
ed38a871
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
fs/s3fs.py
+5
-0
fs/tests.py
+2
-2
No files found.
fs/s3fs.py
View file @
bd63700f
...
...
@@ -86,6 +86,11 @@ class S3FS(FS):
try
:
return
self
.
__dict__
[
'_s3bukt'
]
except
KeyError
:
try
:
b
=
self
.
_s3conn
.
get_bucket
(
self
.
_bucket_name
)
except
S3ResponseError
,
e
:
if
"404 Not Found"
not
in
str
(
e
):
raise
e
b
=
self
.
_s3conn
.
create_bucket
(
self
.
_bucket_name
)
self
.
__dict__
[
'_s3bukt'
]
=
b
return
b
...
...
fs/tests.py
View file @
bd63700f
...
...
@@ -711,7 +711,7 @@ class TestAppendZipFS(TestWriteZipFS):
import
s3fs
class
TestS3FS
(
TestOSFS
):
bucket
=
"test-s3fs.rfk.id.au"
bucket
=
"test-s3fs
-new
.rfk.id.au"
def
setUp
(
self
):
self
.
fs
=
s3fs
.
S3FS
(
self
.
bucket
,
"/unittest/files"
)
...
...
@@ -728,7 +728,7 @@ class TestS3FS(TestOSFS):
self
.
_clear
()
for
k
in
self
.
fs
.
_s3bukt
.
list
():
self
.
fs
.
_s3bukt
.
delete_key
(
k
)
self
.
fs
.
_s3conn
.
delete_bucket
(
self
.
bucket
)
#
self.fs._s3conn.delete_bucket(self.bucket)
def
check
(
self
,
p
):
return
self
.
fs
.
exists
(
p
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment