Revision 34f3d4fa snf-pithos-backend/pithos/backends/modular.py
b/snf-pithos-backend/pithos/backends/modular.py | ||
---|---|---|
46 | 46 |
except ImportError: |
47 | 47 |
AstakosClient = None |
48 | 48 |
|
49 |
from base import (DEFAULT_ACCOUNT_QUOTA, DEFAULT_CONTAINER_QUOTA, |
|
50 |
DEFAULT_CONTAINER_VERSIONING, NotAllowedError, QuotaError, |
|
51 |
BaseBackend, AccountExists, ContainerExists, AccountNotEmpty, |
|
52 |
ContainerNotEmpty, ItemNotExists, VersionNotExists, |
|
53 |
InvalidHash, IllegalOperationError) |
|
49 |
from pithos.backends.base import ( |
|
50 |
DEFAULT_ACCOUNT_QUOTA, DEFAULT_CONTAINER_QUOTA, |
|
51 |
DEFAULT_CONTAINER_VERSIONING, NotAllowedError, QuotaError, |
|
52 |
BaseBackend, AccountExists, ContainerExists, AccountNotEmpty, |
|
53 |
ContainerNotEmpty, ItemNotExists, VersionNotExists, |
|
54 |
InvalidHash, IllegalOperationError) |
|
54 | 55 |
|
55 | 56 |
|
56 | 57 |
class DisabledAstakosClient(object): |
... | ... | |
1222 | 1223 |
for h in hashmap: |
1223 | 1224 |
if h.startswith('archip_'): |
1224 | 1225 |
raise IllegalOperationError( |
1225 |
'Cannot update Archipelago Volume hashmap.')
|
|
1226 |
'Cannot update Archipelago Volume hashmap.') |
|
1226 | 1227 |
meta = meta or {} |
1227 | 1228 |
if size == 0: # No such thing as an empty hashmap. |
1228 | 1229 |
hashmap = [self.put_block('')] |
... | ... | |
1535 | 1536 |
logger.debug("update_block: %s %s %s", hash, len(data), offset) |
1536 | 1537 |
if hash.startswith('archip_'): |
1537 | 1538 |
raise IllegalOperationError( |
1538 |
'Cannot update an Archipelago Volume block.')
|
|
1539 |
'Cannot update an Archipelago Volume block.') |
|
1539 | 1540 |
if offset == 0 and len(data) == self.block_size: |
1540 | 1541 |
return self.put_block(data) |
1541 | 1542 |
h = self.store.block_update(self._unhexlify_hash(hash), offset, data) |
Also available in: Unified diff