diff options
| author | Tushar Patil <tushar.vitthal.patil@gmail.com> | 2011-08-31 17:30:11 -0700 |
|---|---|---|
| committer | Tushar Patil <tushar.vitthal.patil@gmail.com> | 2011-08-31 17:30:11 -0700 |
| commit | 20beec509aff1bb3a30e9f1d95d3e2825f2b38ea (patch) | |
| tree | 755441a8329d0aab00915ccbdcc0cb90de925331 | |
| parent | 65231ec1b9296bb26544d414e3033c9058ba07b7 (diff) | |
Fix for LP Bug #838466
| -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 e045ef3de..6806522f7 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -383,10 +383,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'] @@ -400,6 +396,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, |
