summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorAaron Rosen <arosen@nicira.com>2012-11-07 15:57:12 -0800
committerAaron Rosen <arosen@nicira.com>2012-11-14 15:10:50 -0800
commit45402ff2ddf772e744bdb117d4c2edd4c74d8e7e (patch)
tree0486746200254e0f76e75d75308a3a9f52d5ca4c /nova
parentdbe2b2d54888617b2c6ba1b38576ed8fc691e4c2 (diff)
downloadnova-45402ff2ddf772e744bdb117d4c2edd4c74d8e7e.tar.gz
nova-45402ff2ddf772e744bdb117d4c2edd4c74d8e7e.tar.xz
nova-45402ff2ddf772e744bdb117d4c2edd4c74d8e7e.zip
create_db_entry_for_new_instance did not call sgh for default
When an instance is launched create_db_entry_for_new_instance() is called which calls self.db.instance_create(). Then, db.security_group_ensure_default() is called which creates the default security group entry in the nova db. Though the sgh handler was not called. Alternatively, if any nova secgroup-* call is made the sgh is called which creates the default security group. This patch adds a call to ensure_default() before db.instance_create() so the sgh is called. Fixes a case missed in bug 1050982 Change-Id: I9649b5ef026ca18a55abfb66e87fd0e358eba6f2
Diffstat (limited to 'nova')
-rw-r--r--nova/compute/api.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 5a8bcad2f..8c611f2fd 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -732,6 +732,10 @@ class API(base.Base):
self._populate_instance_shutdown_terminate(instance, image,
block_device_mapping)
+ # ensure_default security group is called before the instance
+ # is created so the creation of the default security group is
+ # proxied to the sgh.
+ self.security_group_api.ensure_default(context)
instance = self.db.instance_create(context, instance)
self._populate_instance_for_bdm(context, instance,