summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorBrian Waldon <brian.waldon@rackspace.com>2011-12-07 11:59:14 -0500
committerBrian Waldon <brian.waldon@rackspace.com>2011-12-07 14:54:34 -0500
commitc3b7cce8101548428b64abb23ab88482bc79c36e (patch)
tree3e5d77157b1e092978ef61e5fcb4fc1eb4288f11 /nova/compute
parent8a8dd22aea07dcbbfa80ea5519dcb7bfb92b0217 (diff)
Clean up snapshot metadata
- Removed image_state from compute api snapshot (only needed by ec2/s3) - Only set backup_type when image_type is 'backup' - Add testing to verify snapshots/backups get the correct metadata Change-Id: Ib5461f9aa790d7ed5629c591bbe1510443dbc2aa
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/api.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index d3b329685..f65b5cead 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -1131,11 +1131,15 @@ class API(base.Base):
if task_state == task_states.IMAGE_SNAPSHOT:
raise exception.InstanceSnapshotting(instance_uuid=instance_uuid)
- properties = {'instance_uuid': instance_uuid,
- 'user_id': str(context.user_id),
- 'image_state': 'creating',
- 'image_type': image_type,
- 'backup_type': backup_type}
+ properties = {
+ 'instance_uuid': instance_uuid,
+ 'user_id': str(context.user_id),
+ 'image_type': image_type,
+ }
+
+ if image_type == 'backup':
+ properties['backup_type'] = backup_type
+
properties.update(extra_properties or {})
sent_meta = {'name': name, 'is_public': False,
'status': 'creating', 'properties': properties}