summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Still <mikal@stillhq.com>2012-04-12 12:36:24 +1000
committerMichael Still <mikal@stillhq.com>2012-05-01 16:15:03 +1000
commit03a331cdfe492cb7a9d531021b444384a27bdd56 (patch)
treed4e8a83c3dc274cbd2ac34bbced75bdb57e57206
parentfb58a57af6c9e88cc1696378fbd4bb72307bcbcb (diff)
Log instance consistently.
Change-Id: Icd0d5021de768ab16b1b766f27ed03df61546239
-rw-r--r--nova/virt/firewall.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/nova/virt/firewall.py b/nova/virt/firewall.py
index af13a5817..b70e164b1 100644
--- a/nova/virt/firewall.py
+++ b/nova/virt/firewall.py
@@ -127,16 +127,16 @@ class IptablesFirewallDriver(FirewallDriver):
self.remove_filters_for_instance(instance)
self.iptables.apply()
else:
- LOG.info(_('Attempted to unfilter instance %s which is not '
- 'filtered'), instance['id'])
+ LOG.info(_('Attempted to unfilter instance which is not '
+ 'filtered'), instance=instance)
def prepare_instance_filter(self, instance, network_info):
self.instances[instance['id']] = instance
self.network_infos[instance['id']] = network_info
self.add_filters_for_instance(instance)
- LOG.debug(_('Filters added to instance %s'), instance['uuid'])
+ LOG.debug(_('Filters added to instance'), instance=instance)
self.refresh_provider_fw_rules()
- LOG.debug(_('Provider Firewall Rules refreshed'))
+ LOG.debug(_('Provider Firewall Rules refreshed'), instance=instance)
self.iptables.apply()
def _create_filter(self, ips, chain_name):
@@ -288,7 +288,8 @@ class IptablesFirewallDriver(FirewallDriver):
security_group['id'])
for rule in rules:
- LOG.debug(_('Adding security group rule: %r'), rule)
+ LOG.debug(_('Adding security group rule: %r'), rule,
+ instance=instance)
if not rule.cidr:
version = 4
@@ -313,7 +314,7 @@ class IptablesFirewallDriver(FirewallDriver):
elif protocol == 'icmp':
args += self._build_icmp_rule(rule, version)
if rule.cidr:
- LOG.debug('Using cidr %r', rule.cidr)
+ LOG.debug('Using cidr %r', rule.cidr, instance=instance)
args += ['-s', rule.cidr]
fw_rules += [' '.join(args)]
else:
@@ -326,7 +327,6 @@ class IptablesFirewallDriver(FirewallDriver):
import nova.network
nw_api = nova.network.API()
for instance in rule['grantee_group']['instances']:
- LOG.debug('instance: %r', instance)
nw_info = nw_api.get_instance_nw_info(ctxt,
instance)
@@ -334,12 +334,13 @@ class IptablesFirewallDriver(FirewallDriver):
for ip in nw_info.fixed_ips()
if ip['version'] == version]
- LOG.debug('ips: %r', ips)
+ LOG.debug('ips: %r', ips, instance=instance)
for ip in ips:
subrule = args + ['-s %s' % ip]
fw_rules += [' '.join(subrule)]
- LOG.debug('Using fw_rules: %r', fw_rules)
+ LOG.debug('Using fw_rules: %r', fw_rules, instance=instance)
+
ipv4_rules += ['-j $sg-fallback']
ipv6_rules += ['-j $sg-fallback']