diff options
| author | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2011-09-06 15:23:10 +0000 |
|---|---|---|
| committer | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2011-09-06 15:23:10 +0000 |
| commit | f05f3273b1e7a9f647b175aef9dcd950ea5ba688 (patch) | |
| tree | 074741b047801f35d89a0599c9ffad56ba3d2163 /nova/compute | |
| parent | 71b7298788045d4832dd8ec44cba3785955aa847 (diff) | |
| parent | 78a63bcad5f29c8927151556229271668b0f9e2b (diff) | |
Merge with trunk
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index 5a73e6d2b..6037903c4 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -385,10 +385,6 @@ class API(base.Base): If you are changing this method, be sure to update both call paths. """ - instance = dict(launch_index=num, **base_options) - instance = self.db.instance_create(context, instance) - instance_id = instance['id'] - elevated = context.elevated() if security_group is None: security_group = ['default'] @@ -402,6 +398,10 @@ class API(base.Base): security_group_name) security_groups.append(group['id']) + instance = dict(launch_index=num, **base_options) + instance = self.db.instance_create(context, instance) + instance_id = instance['id'] + for security_group_id in security_groups: self.db.instance_add_security_group(elevated, instance_id, |
