richleland / django-cumulus (http://packages.python.org/django-cumulus/)

An interface to Rackspace Cloud Files through Django.

Clone this repository (size: 76.4 KB): HTTPS / SSH
$ hg clone http://code.richleland.com/django-cumulus
commit 47: ea126aed9c91
parent 46: 17226e6b1666
branch: default
Catching 404 ResponseErrors on delete() and silencing per django docs re: storage backends.
Ian Schenck / ianschenck
4 months ago

Changed (Δ165 bytes):

raw changeset »

cumulus/storage.py (8 lines added, 2 lines removed)

Up to file-list cumulus/storage.py:

@@ -7,7 +7,7 @@ from django.utils.text import get_valid_
7
7
8
8
try:
9
9
    import cloudfiles
10
    from cloudfiles.errors import NoSuchObject
10
    from cloudfiles.errors import NoSuchObject, ResponseError
11
11
except ImportError:
12
12
    raise ImproperlyConfigured("Could not load cloudfiles dependency. See "
13
13
                               "http://www.mosso.com/cloudfiles.jsp.")
@@ -130,7 +130,13 @@ class CloudFilesStorage(Storage):
130
130
        """
131
131
        Deletes the specified file from the storage system.
132
132
        """
133
        self.container.delete_object(name)
133
        try:
134
            self.container.delete_object(name)
135
        except ResponseError as exc:
136
            if exc.status == 404: 
137
                pass
138
            else:
139
                raise
134
140
135
141
    def exists(self, name):
136
142
        """