root / snf-cyclades-app / synnefo / plankton / backend.py @ 09458eac
History | View | Annotate | Download (20.1 kB)
1 |
# Copyright 2011-2013 GRNET S.A. All rights reserved.
|
---|---|
2 |
|
3 |
#
|
4 |
# Redistribution and use in source and binary forms, with or
|
5 |
# without modification, are permitted provided that the following
|
6 |
# conditions are met:
|
7 |
#
|
8 |
# 1. Redistributions of source code must retain the above
|
9 |
# copyright notice, this list of conditions and the following
|
10 |
# disclaimer.
|
11 |
#
|
12 |
# 2. Redistributions in binary form must reproduce the above
|
13 |
# copyright notice, this list of conditions and the following
|
14 |
# disclaimer in the documentation and/or other materials
|
15 |
# provided with the distribution.
|
16 |
#
|
17 |
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
|
18 |
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
19 |
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
20 |
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
|
21 |
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
22 |
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
23 |
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
24 |
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
25 |
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
26 |
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
27 |
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28 |
# POSSIBILITY OF SUCH DAMAGE.
|
29 |
#
|
30 |
# The views and conclusions contained in the software and
|
31 |
# documentation are those of the authors and should not be
|
32 |
# interpreted as representing official policies, either expressed
|
33 |
# or implied, of GRNET S.A.
|
34 |
|
35 |
"""
|
36 |
The Plankton attributes are the following:
|
37 |
- checksum: the 'hash' meta
|
38 |
- container_format: stored as a user meta
|
39 |
- created_at: the 'modified' meta of the first version
|
40 |
- deleted_at: the timestamp of the last version
|
41 |
- disk_format: stored as a user meta
|
42 |
- id: the 'uuid' meta
|
43 |
- is_public: True if there is a * entry for the read permission
|
44 |
- location: generated based on the file's path
|
45 |
- name: stored as a user meta
|
46 |
- owner: the file's account
|
47 |
- property_*: stored as user meta prefixed with PROPERTY_PREFIX
|
48 |
- size: the 'bytes' meta
|
49 |
- status: stored as a system meta
|
50 |
- store: is always 'pithos'
|
51 |
- updated_at: the 'modified' meta
|
52 |
"""
|
53 |
|
54 |
import json |
55 |
import warnings |
56 |
import logging |
57 |
import os |
58 |
|
59 |
from time import time, gmtime, strftime |
60 |
from functools import wraps |
61 |
from operator import itemgetter |
62 |
|
63 |
from django.conf import settings |
64 |
from django.utils import importlib |
65 |
from pithos.backends.base import NotAllowedError, VersionNotExists |
66 |
|
67 |
logger = logging.getLogger(__name__) |
68 |
|
69 |
|
70 |
PLANKTON_DOMAIN = 'plankton'
|
71 |
PLANKTON_PREFIX = 'plankton:'
|
72 |
PROPERTY_PREFIX = 'property_'
|
73 |
|
74 |
PLANKTON_META = ('container_format', 'disk_format', 'name', |
75 |
'status', 'created_at') |
76 |
|
77 |
from pithos.backends.util import PithosBackendPool |
78 |
_pithos_backend_pool = \ |
79 |
PithosBackendPool( |
80 |
settings.PITHOS_BACKEND_POOL_SIZE, |
81 |
astakos_auth_url=settings.ASTAKOS_AUTH_URL, |
82 |
service_token=settings.CYCLADES_SERVICE_TOKEN, |
83 |
astakosclient_poolsize=settings.CYCLADES_ASTAKOSCLIENT_POOLSIZE, |
84 |
db_connection=settings.BACKEND_DB_CONNECTION, |
85 |
block_path=settings.BACKEND_BLOCK_PATH) |
86 |
|
87 |
|
88 |
def get_pithos_backend(): |
89 |
return _pithos_backend_pool.pool_get()
|
90 |
|
91 |
|
92 |
def create_url(account, container, name): |
93 |
assert "/" not in account, "Invalid account" |
94 |
assert "/" not in container, "Invalid container" |
95 |
return "pithos://%s/%s/%s" % (account, container, name) |
96 |
|
97 |
|
98 |
def split_url(url): |
99 |
"""Returns (accout, container, object) from a url string"""
|
100 |
t = url.split('/', 4) |
101 |
assert t[0] == "pithos:", "Invalid url" |
102 |
assert len(t) == 5, "Invalid url" |
103 |
return t[2:5] |
104 |
|
105 |
|
106 |
def format_timestamp(t): |
107 |
return strftime('%Y-%m-%d %H:%M:%S', gmtime(t)) |
108 |
|
109 |
|
110 |
def handle_backend_exceptions(func): |
111 |
@wraps(func)
|
112 |
def wrapper(*args, **kwargs): |
113 |
try:
|
114 |
return func(*args, **kwargs)
|
115 |
except NotAllowedError:
|
116 |
raise Forbidden
|
117 |
except NameError: |
118 |
raise ImageNotFound
|
119 |
except VersionNotExists:
|
120 |
raise ImageNotFound
|
121 |
return wrapper
|
122 |
|
123 |
|
124 |
def commit_on_success(func): |
125 |
def wrapper(self, *args, **kwargs): |
126 |
backend = self.backend
|
127 |
backend.pre_exec() |
128 |
try:
|
129 |
ret = func(self, *args, **kwargs)
|
130 |
except:
|
131 |
backend.post_exec(False)
|
132 |
raise
|
133 |
else:
|
134 |
backend.post_exec(True)
|
135 |
return ret
|
136 |
return wrapper
|
137 |
|
138 |
|
139 |
class ImageBackend(object): |
140 |
"""A wrapper arround the pithos backend to simplify image handling."""
|
141 |
|
142 |
def __init__(self, user): |
143 |
self.user = user
|
144 |
|
145 |
original_filters = warnings.filters |
146 |
warnings.simplefilter('ignore') # Suppress SQLAlchemy warnings |
147 |
self.backend = get_pithos_backend()
|
148 |
warnings.filters = original_filters # Restore warnings
|
149 |
|
150 |
def close(self): |
151 |
"""Close PithosBackend(return to pool)"""
|
152 |
self.backend.close()
|
153 |
|
154 |
@handle_backend_exceptions
|
155 |
@commit_on_success
|
156 |
def get_image(self, image_uuid): |
157 |
"""Retrieve information about an image."""
|
158 |
image_url = self._get_image_url(image_uuid)
|
159 |
return self._get_image(image_url) |
160 |
|
161 |
def _get_image_url(self, image_uuid): |
162 |
"""Get the Pithos url that corresponds to an image UUID."""
|
163 |
account, container, name = self.backend.get_uuid(self.user, image_uuid) |
164 |
return create_url(account, container, name)
|
165 |
|
166 |
def _get_image(self, image_url): |
167 |
"""Get information about an Image.
|
168 |
|
169 |
Get all available information about an Image.
|
170 |
"""
|
171 |
account, container, name = split_url(image_url) |
172 |
try:
|
173 |
meta = self._get_meta(image_url)
|
174 |
meta["deleted"] = "" |
175 |
except NameError: |
176 |
versions = self.backend.list_versions(self.user, account, |
177 |
container, name) |
178 |
if not versions: |
179 |
raise Exception("Image without versions %s" % image_url) |
180 |
# Object was deleted, use the latest version
|
181 |
version, timestamp = versions[-1]
|
182 |
meta = self._get_meta(image_url, version)
|
183 |
meta["deleted"] = timestamp
|
184 |
|
185 |
if PLANKTON_PREFIX + 'name' not in meta: |
186 |
logger.warning("Image without Plankton name! url %s meta %s",
|
187 |
image_url, meta) |
188 |
meta[PLANKTON_PREFIX + "name"] = "" |
189 |
|
190 |
permissions = self._get_permissions(image_url)
|
191 |
return image_to_dict(image_url, meta, permissions)
|
192 |
|
193 |
def _get_meta(self, image_url, version=None): |
194 |
"""Get object's metadata."""
|
195 |
account, container, name = split_url(image_url) |
196 |
return self.backend.get_object_meta(self.user, account, container, |
197 |
name, PLANKTON_DOMAIN, version) |
198 |
|
199 |
def _update_meta(self, image_url, meta, replace=False): |
200 |
"""Update object's metadata."""
|
201 |
account, container, name = split_url(image_url) |
202 |
|
203 |
prefixed = {} |
204 |
for key, val in meta.items(): |
205 |
if key in PLANKTON_META or key.startswith(PROPERTY_PREFIX): |
206 |
k = PLANKTON_PREFIX + key |
207 |
v = str(val)
|
208 |
if len(k) > 128: |
209 |
raise ValueError('Metadata keys should be less than 128 ' |
210 |
'characters')
|
211 |
if len(v) > 256: |
212 |
raise ValueError('Metadata values should be less than 256 ' |
213 |
'characters.')
|
214 |
prefixed[k] = v |
215 |
|
216 |
self.backend.update_object_meta(self.user, account, container, name, |
217 |
PLANKTON_DOMAIN, prefixed, replace) |
218 |
logger.debug("User '%s' updated image '%s', meta: '%s'", self.user, |
219 |
image_url, prefixed) |
220 |
|
221 |
def _get_permissions(self, image_url): |
222 |
"""Get object's permissions."""
|
223 |
account, container, name = split_url(image_url) |
224 |
_a, path, permissions = \ |
225 |
self.backend.get_object_permissions(self.user, account, container, |
226 |
name) |
227 |
|
228 |
if path is None and permissions != {}: |
229 |
logger.warning("Image '%s' got permissions '%s' from 'None' path.",
|
230 |
image_url, permissions) |
231 |
raise Exception("Database Inconsistency Error:" |
232 |
" Image '%s' got permissions from 'None' path." %
|
233 |
image_url) |
234 |
|
235 |
return permissions
|
236 |
|
237 |
def _update_permissions(self, image_url, permissions): |
238 |
"""Update object's permissions."""
|
239 |
account, container, name = split_url(image_url) |
240 |
self.backend.update_object_permissions(self.user, account, container, |
241 |
name, permissions) |
242 |
logger.debug("User '%s' updated image '%s', permissions: '%s'",
|
243 |
self.user, image_url, permissions)
|
244 |
|
245 |
@handle_backend_exceptions
|
246 |
@commit_on_success
|
247 |
def unregister(self, image_uuid): |
248 |
"""Unregister an image.
|
249 |
|
250 |
Unregister an image, by removing all metadata from the Pithos
|
251 |
file that exist in the PLANKTON_DOMAIN.
|
252 |
|
253 |
"""
|
254 |
image_url = self._get_image_url(image_uuid)
|
255 |
self._get_image(image_url) # Assert that it is an image |
256 |
# Unregister the image by removing all metadata from domain
|
257 |
# 'PLANKTON_DOMAIN'
|
258 |
meta = {} |
259 |
self._update_meta(image_url, meta, True) |
260 |
logger.debug("User '%s' deleted image '%s'", self.user, image_url) |
261 |
|
262 |
@handle_backend_exceptions
|
263 |
@commit_on_success
|
264 |
def add_user(self, image_uuid, add_user): |
265 |
"""Add a user as an image member.
|
266 |
|
267 |
Update read permissions of Pithos file, to include the specified user.
|
268 |
|
269 |
"""
|
270 |
image_url = self._get_image_url(image_uuid)
|
271 |
self._get_image(image_url) # Assert that it is an image |
272 |
permissions = self._get_permissions(image_url)
|
273 |
read = set(permissions.get("read", [])) |
274 |
assert(isinstance(add_user, (str, unicode))) |
275 |
read.add(add_user) |
276 |
permissions["read"] = list(read) |
277 |
self._update_permissions(image_url, permissions)
|
278 |
|
279 |
@handle_backend_exceptions
|
280 |
@commit_on_success
|
281 |
def remove_user(self, image_uuid, remove_user): |
282 |
"""Remove the user from image members.
|
283 |
|
284 |
Remove the specified user from the read permissions of the Pithos file.
|
285 |
|
286 |
"""
|
287 |
image_url = self._get_image_url(image_uuid)
|
288 |
self._get_image(image_url) # Assert that it is an image |
289 |
permissions = self._get_permissions(image_url)
|
290 |
read = set(permissions.get("read", [])) |
291 |
assert(isinstance(remove_user, (str, unicode))) |
292 |
try:
|
293 |
read.remove(remove_user) |
294 |
except ValueError: |
295 |
return # TODO: User did not have access |
296 |
permissions["read"] = list(read) |
297 |
self._update_permissions(image_url, permissions)
|
298 |
|
299 |
@handle_backend_exceptions
|
300 |
@commit_on_success
|
301 |
def replace_users(self, image_uuid, replace_users): |
302 |
"""Replace image members.
|
303 |
|
304 |
Replace the read permissions of the Pithos files with the specified
|
305 |
users. If image is specified as public, we must preserve * permission.
|
306 |
|
307 |
"""
|
308 |
image_url = self._get_image_url(image_uuid)
|
309 |
image = self._get_image(image_url)
|
310 |
permissions = self._get_permissions(image_url)
|
311 |
assert(isinstance(replace_users, list)) |
312 |
permissions["read"] = replace_users
|
313 |
if image.get("is_public", False): |
314 |
permissions["read"].append("*") |
315 |
self._update_permissions(image_url, permissions)
|
316 |
|
317 |
@handle_backend_exceptions
|
318 |
@commit_on_success
|
319 |
def list_users(self, image_uuid): |
320 |
"""List the image members.
|
321 |
|
322 |
List the image members, by listing all users that have read permission
|
323 |
to the corresponding Pithos file.
|
324 |
|
325 |
"""
|
326 |
image_url = self._get_image_url(image_uuid)
|
327 |
self._get_image(image_url) # Assert that it is an image |
328 |
permissions = self._get_permissions(image_url)
|
329 |
return [user for user in permissions.get('read', []) if user != '*'] |
330 |
|
331 |
@handle_backend_exceptions
|
332 |
@commit_on_success
|
333 |
def update_metadata(self, image_uuid, metadata): |
334 |
"""Update Image metadata."""
|
335 |
image_url = self._get_image_url(image_uuid)
|
336 |
self._get_image(image_url) # Assert that it is an image |
337 |
|
338 |
is_public = metadata.pop("is_public", None) |
339 |
if is_public is not None: |
340 |
permissions = self._get_permissions(image_url)
|
341 |
read = set(permissions.get("read", [])) |
342 |
if is_public:
|
343 |
read.add("*")
|
344 |
else:
|
345 |
read.discard("*")
|
346 |
permissions["read"] = list(read) |
347 |
self._update_permissions(image_url, permissions)
|
348 |
meta = {} |
349 |
meta.update(**metadata) |
350 |
|
351 |
self._update_meta(image_url, meta)
|
352 |
image_url = self._get_image_url(image_uuid)
|
353 |
return self._get_image(image_url) |
354 |
|
355 |
@handle_backend_exceptions
|
356 |
@commit_on_success
|
357 |
def register(self, name, image_url, metadata): |
358 |
# Validate that metadata are allowed
|
359 |
if "id" in metadata: |
360 |
raise ValueError("Passing an ID is not supported") |
361 |
store = metadata.pop("store", "pithos") |
362 |
if store != "pithos": |
363 |
raise ValueError("Invalid store '%s'. Only 'pithos' store is" |
364 |
"supported" % store)
|
365 |
disk_format = metadata.setdefault("disk_format",
|
366 |
settings.DEFAULT_DISK_FORMAT) |
367 |
if disk_format not in settings.ALLOWED_DISK_FORMATS: |
368 |
raise ValueError("Invalid disk format '%s'" % disk_format) |
369 |
container_format =\ |
370 |
metadata.setdefault("container_format",
|
371 |
settings.DEFAULT_CONTAINER_FORMAT) |
372 |
if container_format not in settings.ALLOWED_CONTAINER_FORMATS: |
373 |
raise ValueError("Invalid container format '%s'" % |
374 |
container_format) |
375 |
|
376 |
# Validate that 'size' and 'checksum' are valid
|
377 |
account, container, object = split_url(image_url) |
378 |
|
379 |
meta = self._get_meta(image_url)
|
380 |
|
381 |
size = int(metadata.pop('size', meta['bytes'])) |
382 |
if size != meta['bytes']: |
383 |
raise ValueError("Invalid size") |
384 |
|
385 |
checksum = metadata.pop('checksum', meta['hash']) |
386 |
if checksum != meta['hash']: |
387 |
raise ValueError("Invalid checksum") |
388 |
|
389 |
# Fix permissions
|
390 |
is_public = metadata.pop('is_public', False) |
391 |
if is_public:
|
392 |
permissions = {'read': ['*']} |
393 |
else:
|
394 |
permissions = {'read': [self.user]} |
395 |
|
396 |
# Update rest metadata
|
397 |
meta = {} |
398 |
# Add creation(register) timestamp as a metadata, to avoid extra
|
399 |
# queries when retrieving the list of images.
|
400 |
meta['created_at'] = time()
|
401 |
meta.update(name=name, status='available', **metadata)
|
402 |
|
403 |
# Do the actualy update in the Pithos backend
|
404 |
self._update_meta(image_url, meta)
|
405 |
self._update_permissions(image_url, permissions)
|
406 |
logger.debug("User '%s' created image '%s'('%s')", self.user, |
407 |
image_url, name) |
408 |
return self._get_image(image_url) |
409 |
|
410 |
def _list_images(self, user=None, filters=None, params=None): |
411 |
filters = filters or {}
|
412 |
|
413 |
# TODO: Use filters
|
414 |
# # Fix keys
|
415 |
# keys = [PLANKTON_PREFIX + 'name']
|
416 |
# size_range = (None, None)
|
417 |
# for key, val in filters.items():
|
418 |
# if key == 'size_min':
|
419 |
# size_range = (val, size_range[1])
|
420 |
# elif key == 'size_max':
|
421 |
# size_range = (size_range[0], val)
|
422 |
# else:
|
423 |
# keys.append('%s = %s' % (PLANKTON_PREFIX + key, val))
|
424 |
_images = self.backend.get_domain_objects(domain=PLANKTON_DOMAIN,
|
425 |
user=user) |
426 |
|
427 |
images = [] |
428 |
for (location, meta, permissions) in _images: |
429 |
image_url = "pithos://" + location
|
430 |
meta["modified"] = meta["version_timestamp"] |
431 |
images.append(image_to_dict(image_url, meta, permissions)) |
432 |
|
433 |
if params is None: |
434 |
params = {} |
435 |
key = itemgetter(params.get('sort_key', 'created_at')) |
436 |
reverse = params.get('sort_dir', 'desc') == 'desc' |
437 |
images.sort(key=key, reverse=reverse) |
438 |
return images
|
439 |
|
440 |
@commit_on_success
|
441 |
def list_images(self, filters=None, params=None): |
442 |
return self._list_images(user=self.user, filters=filters, |
443 |
params=params) |
444 |
|
445 |
@commit_on_success
|
446 |
def list_shared_images(self, member, filters=None, params=None): |
447 |
images = self._list_images(user=self.user, filters=filters, |
448 |
params=params) |
449 |
is_shared = lambda img: not img["is_public"] and img["owner"] == member |
450 |
return filter(is_shared, images) |
451 |
|
452 |
@commit_on_success
|
453 |
def list_public_images(self, filters=None, params=None): |
454 |
images = self._list_images(user=None, filters=filters, params=params) |
455 |
return filter(lambda img: img["is_public"], images) |
456 |
|
457 |
|
458 |
class ImageBackendError(Exception): |
459 |
pass
|
460 |
|
461 |
|
462 |
class ImageNotFound(ImageBackendError): |
463 |
pass
|
464 |
|
465 |
|
466 |
class Forbidden(ImageBackendError): |
467 |
pass
|
468 |
|
469 |
|
470 |
def image_to_dict(image_url, meta, permissions): |
471 |
"""Render an image to a dictionary"""
|
472 |
account, container, name = split_url(image_url) |
473 |
|
474 |
image = {} |
475 |
if PLANKTON_PREFIX + 'name' not in meta: |
476 |
logger.warning("Image without Plankton name!! url %s meta %s",
|
477 |
image_url, meta) |
478 |
image[PLANKTON_PREFIX + "name"] = "" |
479 |
|
480 |
image["id"] = meta["uuid"] |
481 |
image["location"] = image_url
|
482 |
image["checksum"] = meta["hash"] |
483 |
created = meta.get("created_at", meta["modified"]) |
484 |
image["created_at"] = format_timestamp(created)
|
485 |
deleted = meta.get("deleted", None) |
486 |
image["deleted_at"] = format_timestamp(deleted) if deleted else "" |
487 |
image["updated_at"] = format_timestamp(meta["modified"]) |
488 |
image["size"] = meta["bytes"] |
489 |
image["store"] = "pithos" |
490 |
image['owner'] = account
|
491 |
|
492 |
# Permissions
|
493 |
image["is_public"] = "*" in permissions.get('read', []) |
494 |
|
495 |
for key, val in meta.items(): |
496 |
# Get plankton properties
|
497 |
if key.startswith(PLANKTON_PREFIX):
|
498 |
# Remove plankton prefix
|
499 |
key = key.replace(PLANKTON_PREFIX, "")
|
500 |
# Keep only those in plankton meta
|
501 |
if key in PLANKTON_META or key.startswith(PROPERTY_PREFIX): |
502 |
if key == "created_at": |
503 |
# created timestamp is return in 'created_at' field
|
504 |
pass
|
505 |
else:
|
506 |
image[key] = val |
507 |
|
508 |
return image
|
509 |
|
510 |
|
511 |
class JSONFileBackend(object): |
512 |
"""
|
513 |
A dummy image backend that loads available images from a file with json
|
514 |
formatted content.
|
515 |
|
516 |
usage:
|
517 |
PLANKTON_BACKEND_MODULE = 'synnefo.plankton.backend.JSONFileBackend'
|
518 |
PLANKTON_IMAGES_JSON_BACKEND_FILE = '/tmp/images.json'
|
519 |
|
520 |
# loading images from an existing plankton service
|
521 |
$ curl -H "X-Auth-Token: <MYTOKEN>" \
|
522 |
https://cyclades.synnefo.org/plankton/images/detail | \
|
523 |
python -m json.tool > /tmp/images.json
|
524 |
"""
|
525 |
def __init__(self, userid): |
526 |
self.images_file = getattr(settings, |
527 |
'PLANKTON_IMAGES_JSON_BACKEND_FILE', '') |
528 |
if not os.path.exists(self.images_file): |
529 |
raise Exception("Invalid plankgon images json backend file: %s", |
530 |
self.images_file)
|
531 |
fp = file(self.images_file) |
532 |
self.images = json.load(fp)
|
533 |
fp.close() |
534 |
|
535 |
def iter(self, *args, **kwargs): |
536 |
return self.images.__iter__() |
537 |
|
538 |
def list_images(self, *args, **kwargs): |
539 |
return self.images |
540 |
|
541 |
def get_image(self, image_uuid): |
542 |
try:
|
543 |
return filter(lambda i: i['id'] == image_uuid, self.images)[0] |
544 |
except IndexError: |
545 |
raise Exception("Unknown image uuid: %s" % image_uuid) |
546 |
|
547 |
def close(self): |
548 |
pass
|
549 |
|
550 |
|
551 |
def get_backend(): |
552 |
backend_module = getattr(settings, 'PLANKTON_BACKEND_MODULE', None) |
553 |
if not backend_module: |
554 |
# no setting set
|
555 |
return ImageBackend
|
556 |
|
557 |
parts = backend_module.split(".")
|
558 |
module = ".".join(parts[:-1]) |
559 |
cls = parts[-1]
|
560 |
try:
|
561 |
return getattr(importlib.import_module(module), cls) |
562 |
except (ImportError, AttributeError), e: |
563 |
raise ImportError("Cannot import plankton module: %s (%s)" % |
564 |
(backend_module, e.message)) |