Permalink
Browse files

Merge "Centralize sent_meta definition"

  • Loading branch information...
2 parents 1010934 + db1acef commit c50b2cb3c435193c5756f112539722039278b45a Jenkins committed with openstack-gerrit Oct 5, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 nova/compute/api.py
View
@@ -1211,6 +1211,11 @@ def _create_image(self, context, instance, name, image_type,
'user_id': str(context.user_id),
'image_type': image_type,
}
+ sent_meta = {
+ 'name': name,
+ 'is_public': False,
+ 'properties': properties,
+ }
# Persist base image ref as a Glance image property
system_meta = self.db.instance_system_metadata_get(
@@ -1219,8 +1224,6 @@ def _create_image(self, context, instance, name, image_type,
if base_image_ref:
properties['base_image_ref'] = base_image_ref
- sent_meta = {'name': name, 'is_public': False}
-
if image_type == 'backup':
properties['backup_type'] = backup_type
@@ -1249,8 +1252,6 @@ def _create_image(self, context, instance, name, image_type,
# up above will not be overwritten by inherited values
properties.setdefault(key, value)
- sent_meta['properties'] = properties
-
recv_meta = self.image_service.create(context, sent_meta)
self.compute_rpcapi.snapshot_instance(context, instance=instance,
image_id=recv_meta['id'], image_type=image_type,

0 comments on commit c50b2cb

Please sign in to comment.