Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:dpetzold/django-extensions

Conflicts:
	django_extensions/management/commands/rackspace.py
  • Loading branch information...
commit 8eeb89b9830a1661592204691820fe88d0d9bc29 2 parents 78cf045 + 0346f63
@dpetzold authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 django_extensions/management/commands/rackspace.py
View
15 django_extensions/management/commands/rackspace.py
@@ -67,7 +67,7 @@ def cull(self):
def sync(self, path):
- for root, dirs, files in os.walk(path):
+ for root, dirs, files in os.walk(path, followlinks=True):
for name in files:
filepath = os.path.join(root, name)
if filepath.startswith('./'):
@@ -80,8 +80,7 @@ def retry(self, func, filepath, max_attempts=5):
attempts = 0
while True:
try:
- obj = func(filepath)
- return obj
+ return func(filepath)
except ssl.SSLError as e:
if attempts == max_attempts:
raise e
@@ -122,13 +121,15 @@ def sync_file(self, filepath):
print('size: %s %s' % (stat.st_size, obj.size))
- def upload(self, filepath, max_attempts=5, prefix=None):
+ def upload(self, filepath, prefix=None, max_attempts=5):
root, filename = os.path.split(filepath)
- if prefix:
+ if prefix is not None:
filename = '%s/%s' % (prefix, filename)
- obj = self.retry(self.container.create_object, filepath)
+ obj = self.retry(self.container.create_object, filename)
self.retry(obj.load_from_filename, filepath)
- print('%s' % (filepath))
+ if self.verbose:
+ print('Uploaded %s' % (filename))
+ return obj
def list(self, pattern=None):
Please sign in to comment.
Something went wrong with that request. Please try again.