102
94
raise exception.NotFound("Image file %s does not exist" % fn)
97
def add(cls, id, data, options):
107
99
Stores image data to disk and returns a location that the image was
108
100
written to. By default, the backend writes the image data to a file
109
101
`/<DATADIR>/<ID>`, where <DATADIR> is the value of
112
104
:param id: The opaque image identifier
113
105
:param data: The image data to write, as a file-like object
115
108
:retval Tuple with (location, size)
116
109
The location that was written, with file:// scheme prepended
117
110
and the size in bytes of the data written
121
114
if not os.path.exists(datadir):