Permalink
Browse files

Don't try to recreate a bucket dir, if it exists

  • Loading branch information...
1 parent 824c29b commit 514d680d4c77288fc7dbe6a1d4e4a14ccd7b892b John Wiegley committed Dec 19, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 file_store.py
View
@@ -37,7 +37,9 @@ def create_bucket(self, bucket_name):
if bucket_name not in [bucket.name for bucket in self.buckets]:
creation_date = datetime.now().strftime('%Y-%m-%dT%H:%M:%S.000Z')
self.redis.sadd(BUCKETS_KEY, '%s|%s' % (bucket_name, creation_date))
- os.makedirs(os.path.join(self.root, bucket_name))
+ target = os.path.join(self.root, bucket_name)
+ if not os.path.isdir(target):
+ os.makedirs(target)
bucket = Bucket(bucket_name, creation_date)
self.buckets.append(bucket)
else:

0 comments on commit 514d680

Please sign in to comment.