Revision 8d9a3fbd snf-pithos-backend/pithos/backends/modular.py
b/snf-pithos-backend/pithos/backends/modular.py | ||
---|---|---|
77 | 77 |
#DEFAULT_QUEUE_MODULE = 'pithos.backends.lib.rabbitmq' |
78 | 78 |
#DEFAULT_QUEUE_CONNECTION = 'rabbitmq://guest:guest@localhost:5672/pithos' |
79 | 79 |
|
80 |
QUEUE_MESSAGE_KEY = 'pithos'
|
|
80 |
QUEUE_MESSAGE_KEY_PREFIX = 'pithos.%s'
|
|
81 | 81 |
QUEUE_CLIENT_ID = 'pithos' |
82 | 82 |
|
83 | 83 |
( CLUSTER_NORMAL, CLUSTER_HISTORY, CLUSTER_DELETED ) = range(3) |
... | ... | |
157 | 157 |
if queue_module and queue_connection: |
158 | 158 |
self.queue_module = load_module(queue_module) |
159 | 159 |
params = {'exchange': queue_connection, |
160 |
'message_key': QUEUE_MESSAGE_KEY, |
|
161 | 160 |
'client_id': QUEUE_CLIENT_ID} |
162 | 161 |
self.queue = self.queue_module.Queue(**params) |
163 | 162 |
else: |
... | ... | |
1011 | 1010 |
account_node = self._lookup_account(account, True)[1] |
1012 | 1011 |
total = self._get_statistics(account_node)[1] |
1013 | 1012 |
details.update({'user': user, 'total': total}) |
1014 |
self.messages.append((account, 'diskspace', size, details)) |
|
1013 |
self.messages.append((QUEUE_MESSAGE_KEY_PREFIX % ('resource.diskspace',), account, 'diskspace', size, details))
|
|
1015 | 1014 |
|
1016 | 1015 |
def _report_object_change(self, user, account, path, details={}): |
1017 | 1016 |
logger.debug("_report_object_change: %s %s %s %s", user, account, path, details) |
1018 | 1017 |
details.update({'user': user}) |
1019 |
self.messages.append((account, 'object', path, details)) |
|
1018 |
self.messages.append((QUEUE_MESSAGE_KEY_PREFIX % ('object',), account, 'object', path, details))
|
|
1020 | 1019 |
|
1021 | 1020 |
# Policy functions. |
1022 | 1021 |
|
Also available in: Unified diff