diff options
| author | Jason Kölker <jason@koelker.net> | 2012-01-04 11:10:10 -0600 |
|---|---|---|
| committer | Jason Kölker <jason@koelker.net> | 2012-01-16 10:52:56 -0600 |
| commit | bb867ce3948ddc23cf928ca3dda100a1a977896a (patch) | |
| tree | 2931f3ea721e452bed8304fd192024394972b602 /nova/virt | |
| parent | 46f90f7cb79a01104376919c56e70a6324fe89af (diff) | |
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
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/firewall.py | 17 |
1 files changed, 14 insertions, 3 deletions
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) |
