diff options
| author | Soren Hansen <soren.hansen@rackspace.com> | 2010-09-15 12:05:37 +0200 |
|---|---|---|
| committer | Soren Hansen <soren.hansen@rackspace.com> | 2010-09-15 12:05:37 +0200 |
| commit | 62871e83ba9b7bd8b17a7c457d8af7feb18853ea (patch) | |
| tree | b68dc2025e523ed99be305c3b7f25a2a6baad325 | |
| parent | faebe1ecd4aec4e2050a12f191266beadc468134 (diff) | |
| download | nova-62871e83ba9b7bd8b17a7c457d8af7feb18853ea.tar.gz nova-62871e83ba9b7bd8b17a7c457d8af7feb18853ea.tar.xz nova-62871e83ba9b7bd8b17a7c457d8af7feb18853ea.zip | |
More ORM object cleanup.
| -rw-r--r-- | nova/endpoint/cloud.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nova/endpoint/cloud.py b/nova/endpoint/cloud.py index 0289de285..32732e9d5 100644 --- a/nova/endpoint/cloud.py +++ b/nova/endpoint/cloud.py @@ -700,9 +700,9 @@ class CloudController(object): security_groups = [] for security_group_name in security_group_arg: group = db.security_group_get_by_project(context, - context.project.id, + context.project['id'], security_group_name) - security_groups.append(group) + security_groups.append(group['id']) reservation_id = utils.generate_uid('r') base_options = {} @@ -716,11 +716,14 @@ class CloudController(object): base_options['project_id'] = context.project.id base_options['user_data'] = kwargs.get('user_data', '') base_options['instance_type'] = kwargs.get('instance_type', 'm1.small') - base_options['security_groups'] = security_groups for num in range(int(kwargs['max_count'])): inst_id = db.instance_create(context, base_options) + for security_group_id in security_groups: + db.instance_add_security_group(context, inst_id, + security_group_id) + inst = {} inst['mac_address'] = utils.generate_mac() inst['launch_index'] = num |
