From: Stavros Sachtouris Date: Wed, 30 Jan 2013 13:13:21 +0000 (+0200) Subject: download --resume can create new local files X-Git-Tag: 0.9rc1~61^2~27 X-Git-Url: https://code.grnet.gr/git/kamaki/commitdiff_plain/b9ca5b730f12214c700c65115bc4208e1392dda9 download --resume can create new local files --- diff --git a/kamaki/cli/commands/pithos_cli.py b/kamaki/cli/commands/pithos_cli.py index 8e94647..a96b145 100644 --- a/kamaki/cli/commands/pithos_cli.py +++ b/kamaki/cli/commands/pithos_cli.py @@ -1062,7 +1062,6 @@ class store_download(_store_container_command): raiseCLIError('No objects prefixed as %s on container %s' % ( self.path, self.container)) - wmode = 'rwb+' if self['resume'] else 'wb+' progress_bar = None try: for lpath, rpath in sorted(outputs): @@ -1071,6 +1070,8 @@ class store_download(_store_container_command): print('Create directory %s' % lpath) makedirs(lpath) continue + wmode = 'rwb+' if path.exists(lpath) and self['resume']\ + else 'wb+' print('\nFrom %s:%s to %s' % ( self.container, rpath,