diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-12-10 17:21:15 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-12-10 17:21:15 +0000 |
| commit | 50f3fdfbea40637cfbe3d53fee42b717a836466e (patch) | |
| tree | a55e520c4c123efc0dbf01f1fb2144dd028695f8 /nova/api | |
| parent | 522ac62ad5cdc2164e6b9a72c86a889f94a7f23a (diff) | |
| parent | 6c92e3c7885c1eb7da3032862a30a10348b2d810 (diff) | |
| download | nova-50f3fdfbea40637cfbe3d53fee42b717a836466e.tar.gz nova-50f3fdfbea40637cfbe3d53fee42b717a836466e.tar.xz nova-50f3fdfbea40637cfbe3d53fee42b717a836466e.zip | |
Merge "Access DB values as dict not as attributes. Part 4"
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/cloud.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index ab59205a9..8155efb10 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -484,14 +484,14 @@ class CloudController(object): r = {} r['groups'] = [] r['ipRanges'] = [] - if rule.group_id: - source_group = rule.grantee_group - r['groups'] += [{'groupName': source_group.name, - 'userId': source_group.project_id}] - if rule.protocol: - r['ipProtocol'] = rule.protocol.lower() - r['fromPort'] = rule.from_port - r['toPort'] = rule.to_port + if rule['group_id']: + source_group = rule['grantee_group'] + r['groups'] += [{'groupName': source_group['name'], + 'userId': source_group['project_id']}] + if rule['protocol']: + r['ipProtocol'] = rule['protocol'].lower() + r['fromPort'] = rule['from_port'] + r['toPort'] = rule['to_port'] g['ipPermissions'] += [dict(r)] else: for protocol, min_port, max_port in (('icmp', -1, -1), @@ -502,10 +502,10 @@ class CloudController(object): r['toPort'] = max_port g['ipPermissions'] += [dict(r)] else: - r['ipProtocol'] = rule.protocol - r['fromPort'] = rule.from_port - r['toPort'] = rule.to_port - r['ipRanges'] += [{'cidrIp': rule.cidr}] + r['ipProtocol'] = rule['protocol'] + r['fromPort'] = rule['from_port'] + r['toPort'] = rule['to_port'] + r['ipRanges'] += [{'cidrIp': rule['cidr']}] g['ipPermissions'] += [r] return g |
