Revision 825f3123 snf-cyclades-app/synnefo/volume/snapshots.py
b/snf-cyclades-app/synnefo/volume/snapshots.py | ||
---|---|---|
7 | 7 |
from synnefo.logic import backend |
8 | 8 |
from synnefo.volume import util |
9 | 9 |
|
10 |
|
|
11 | 10 |
SNAPSHOTS_CONTAINER = "snapshots" |
12 | 11 |
SNAPSHOTS_DOMAIN = "plankton" |
13 | 12 |
SNAPSHOTS_PREFIX = "plankton:" |
... | ... | |
23 | 22 |
|
24 | 23 |
volume.snapshot_counter += 1 |
25 | 24 |
volume.save() |
25 |
transaction.commit() |
|
26 | 26 |
|
27 | 27 |
snapshot_metadata = {} |
28 | 28 |
snapshot_metadata[SNAPSHOTS_PREFIX + "name"] = description |
... | ... | |
36 | 36 |
snapshot_name = generate_snapshot_name(volume) |
37 | 37 |
mapfile = SNAPSHOTS_MAPFILE_PREFIX + snapshot_name |
38 | 38 |
|
39 |
size = volume.size << 30 |
|
39 | 40 |
with image_backend(user_id) as pithos_backend: |
40 | 41 |
# move this to plankton backend |
41 | 42 |
snapshot_uuid = pithos_backend.backend.register_object_map( |
42 | 43 |
user=user_id, |
43 | 44 |
account=user_id, |
44 | 45 |
container=SNAPSHOTS_CONTAINER, |
45 |
name=name, |
|
46 |
size=volume.size,
|
|
46 |
name=snapshot_name,
|
|
47 |
size=size, |
|
47 | 48 |
type=SNAPSHOTS_TYPE, |
48 | 49 |
mapfile=mapfile, |
49 | 50 |
meta=snapshot_metadata, |
Also available in: Unified diff