~ubuntu-branches/ubuntu/raring/duplicity/raring-updates

« back to all changes in this revision

Viewing changes to src/backends/cloudfilesbackend.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Terry
  • Date: 2011-04-03 20:40:34 UTC
  • mfrom: (1.9.1 upstream) (16.2.6 natty)
  • Revision ID: james.westby@ubuntu.com-20110403204034-5m1eri4z5qr0nyrr
Tags: 0.6.13-0ubuntu1
* Resync with Debian, no remaining changes
* New upstream release
  - silent data corruption with checkpoint/restore (LP: #613244)
  - Assertion error "time not moving forward at appropriate pace"
    (LP: #579958)
* debian/patches/04future.dpatch:
  - Dropped, applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import duplicity.backend
25
25
from duplicity import globals
26
26
from duplicity import log
27
 
from duplicity.errors import *
 
27
from duplicity.errors import * #@UnusedWildImport
28
28
from duplicity.util import exception_traceback
29
29
 
30
30
class CloudFilesBackend(duplicity.backend.Backend):
116
116
                               % (self.container, remote_filename))
117
117
 
118
118
    def list(self):
119
 
        keys = self.container.list_objects()
120
 
        log.Debug("Listed container '%s'" % self.container)
121
 
        return keys
 
119
        for n in range(1, globals.num_retries+1):
 
120
            log.Info("Listing '%s'" % (self.container))
 
121
            try:
 
122
                keys = self.container.list_objects()
 
123
                return keys
 
124
            except self.resp_exc, resperr:
 
125
                log.Warn("Listing of '%s' failed (attempt %s): CloudFiles returned: %s %s"
 
126
                         % (self.container, n, resperr.status, resperr.reason))
 
127
            except Exception, e:
 
128
                log.Warn("Listing of '%s' failed (attempt %s): %s: %s"
 
129
                         % (self.container, n, e.__class__.__name__, str(e)))
 
130
                log.Debug("Backtrace of previous error: %s"
 
131
                          % exception_traceback())
 
132
            time.sleep(30)
 
133
        log.Warn("Giving up listing of '%s' after %s attempts"
 
134
                 % (self.container, globals.num_retries))
 
135
        raise BackendException("Error listing '%s'"
 
136
                               % (self.container))
122
137
 
123
138
    def delete(self, filename_list):
124
139
        for file in filename_list: