summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorJoe Gordon <jogo@cloudscaling.com>2012-11-29 17:10:30 -0800
committerJoe Gordon <jogo@cloudscaling.com>2012-11-29 17:10:30 -0800
commit03ae11664d6d42b02ea2996d0125bcdee87db754 (patch)
treec4b0ffb5ec7bd9ba537273fed1c03b0e95197e99 /nova/virt
parentadb0f2b0b41f5d2be177a497cce864ad8e3879af (diff)
downloadnova-03ae11664d6d42b02ea2996d0125bcdee87db754.tar.gz
nova-03ae11664d6d42b02ea2996d0125bcdee87db754.tar.xz
nova-03ae11664d6d42b02ea2996d0125bcdee87db754.zip
Access DB values as dict not as attributes. Part 2
We cannot assume nova.db.api will be returning sqlalchemy objects with attributes, instead treat return values as dicts Part of blueprint db-api-cleanup Change-Id: I39ccd2f110c258d69bb2d4d7078c672c6a6ef36e
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/firewall.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/nova/virt/firewall.py b/nova/virt/firewall.py
index 11a8ea2bf..ee39b0b8c 100644
--- a/nova/virt/firewall.py
+++ b/nova/virt/firewall.py
@@ -360,20 +360,20 @@ class IptablesFirewallDriver(FirewallDriver):
LOG.debug(_('Adding security group rule: %r'), rule,
instance=instance)
- if not rule.cidr:
+ if not rule['cidr']:
version = 4
else:
- version = netutils.get_ip_version(rule.cidr)
+ version = netutils.get_ip_version(rule['cidr'])
if version == 4:
fw_rules = ipv4_rules
else:
fw_rules = ipv6_rules
- protocol = rule.protocol
+ protocol = rule['protocol']
if protocol:
- protocol = rule.protocol.lower()
+ protocol = rule['protocol'].lower()
if version == 6 and protocol == 'icmp':
protocol = 'icmpv6'
@@ -386,9 +386,9 @@ class IptablesFirewallDriver(FirewallDriver):
args += self._build_tcp_udp_rule(rule, version)
elif protocol == 'icmp':
args += self._build_icmp_rule(rule, version)
- if rule.cidr:
- LOG.debug('Using cidr %r', rule.cidr, instance=instance)
- args += ['-s', rule.cidr]
+ if rule['cidr']:
+ LOG.debug('Using cidr %r', rule['cidr'], instance=instance)
+ args += ['-s', rule['cidr']]
fw_rules += [' '.join(args)]
else:
if rule['grantee_group']: