Revision 16d2d675 snf-pithos-backend/pithos/backends/modular.py
b/snf-pithos-backend/pithos/backends/modular.py | ||
---|---|---|
45 | 45 |
except ImportError: |
46 | 46 |
AstakosClient = None |
47 | 47 |
|
48 |
from base import (DEFAULT_ACCOUNT_QUOTA, DEFAULT_CONTAINER_QUOTA, |
|
49 |
DEFAULT_CONTAINER_VERSIONING, NotAllowedError, QuotaError, |
|
50 |
BaseBackend, AccountExists, ContainerExists, AccountNotEmpty, |
|
51 |
ContainerNotEmpty, ItemNotExists, VersionNotExists, |
|
52 |
InvalidHash, IllegalOperationError) |
|
48 |
from pithos.backends.base import ( |
|
49 |
DEFAULT_ACCOUNT_QUOTA, DEFAULT_CONTAINER_QUOTA, |
|
50 |
DEFAULT_CONTAINER_VERSIONING, NotAllowedError, QuotaError, |
|
51 |
BaseBackend, AccountExists, ContainerExists, AccountNotEmpty, |
|
52 |
ContainerNotEmpty, ItemNotExists, VersionNotExists, |
|
53 |
InvalidHash, IllegalOperationError) |
|
53 | 54 |
|
54 | 55 |
|
55 | 56 |
class DisabledAstakosClient(object): |
... | ... | |
1184 | 1185 |
for h in hashmap: |
1185 | 1186 |
if h.startswith('archip_'): |
1186 | 1187 |
raise IllegalOperationError( |
1187 |
'Cannot update Archipelago Volume hashmap.')
|
|
1188 |
'Cannot update Archipelago Volume hashmap.') |
|
1188 | 1189 |
meta = meta or {} |
1189 | 1190 |
if size == 0: # No such thing as an empty hashmap. |
1190 | 1191 |
hashmap = [self.put_block('')] |
... | ... | |
1493 | 1494 |
logger.debug("update_block: %s %s %s", hash, len(data), offset) |
1494 | 1495 |
if hash.startswith('archip_'): |
1495 | 1496 |
raise IllegalOperationError( |
1496 |
'Cannot update an Archipelago Volume block.')
|
|
1497 |
'Cannot update an Archipelago Volume block.') |
|
1497 | 1498 |
if offset == 0 and len(data) == self.block_size: |
1498 | 1499 |
return self.put_block(data) |
1499 | 1500 |
h = self.store.block_update(self._unhexlify_hash(hash), offset, data) |
Also available in: Unified diff