From bb867ce3948ddc23cf928ca3dda100a1a977896a Mon Sep 17 00:00:00 2001 From: Jason Kölker Date: Wed, 4 Jan 2012 11:10:10 -0600 Subject: Implement BP untie-nova-network-models Fixes LP853979 Remove the FK references for network data. Remove unused db functions that used the FK's Update db functions to not joinload Update notification to optionally take network_info if compute has it Update EC2 Api to use the network cache, falling back to rpc.call Remove test_instance_get_project_vpn_joins which tests calls not used Change-Id: I1a01ccc5ebcf7efeafe014af62be893325bb0825 --- nova/virt/firewall.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'nova/virt') diff --git a/nova/virt/firewall.py b/nova/virt/firewall.py index c60148231..3426120ac 100644 --- a/nova/virt/firewall.py +++ b/nova/virt/firewall.py @@ -303,13 +303,24 @@ class IptablesFirewallDriver(FirewallDriver): fw_rules += [' '.join(args)] else: if rule['grantee_group']: + # FIXME(jkoelker) This needs to be ported up into + # the compute manager which already + # has access to a nw_api handle, + # and should be the only one making + # making rpc calls. + import nova.network + nw_api = nova.network.API() for instance in rule['grantee_group']['instances']: LOG.info('instance: %r', instance) - ips = db.instance_get_fixed_addresses(ctxt, - instance['id']) + ips = [] + nw_info = nw_api.get_instance_nw_info(ctxt, + instance) + for net in nw_info: + ips.extend(net[1]['ips']) + LOG.info('ips: %r', ips) for ip in ips: - subrule = args + ['-s %s' % ip] + subrule = args + ['-s %s' % ip['ip']] fw_rules += [' '.join(subrule)] LOG.info('Using fw_rules: %r', fw_rules) -- cgit