diff options
author | Wangpan <hzwangpan@corp.netease.com> | 2013-02-04 11:45:14 +0800 |
---|---|---|
committer | Wangpan <hzwangpan@corp.netease.com> | 2013-02-04 11:54:08 +0800 |
commit | 7d585b2cdc5f593b293c9e3b150ebf68e547b094 (patch) | |
tree | 60af17f88c0435eeb0663966d48c90ccf8ffd530 | |
parent | ee955d272ab4eef2e8371f2e460454058ce7e46c (diff) | |
download | nova-7d585b2cdc5f593b293c9e3b150ebf68e547b094.tar.gz nova-7d585b2cdc5f593b293c9e3b150ebf68e547b094.tar.xz nova-7d585b2cdc5f593b293c9e3b150ebf68e547b094.zip |
Fix incorrect logs in network
These are negligible typo issues, so a bug isn't filed on LP.
We should log floating ip address and details of networks, rather than "|%s|"
or "|[<nova.db.sqlalchemy.models.Network object at 0x5227510>]|", so moving the
log of floating ip address to the correct location and converting the
sqlalchemy Network object to dict for logging.
Change-Id: I815bf01100d234401114bfd80fd9aa644d1a3447
-rw-r--r-- | nova/network/floating_ips.py | 5 | ||||
-rw-r--r-- | nova/network/manager.py | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/nova/network/floating_ips.py b/nova/network/floating_ips.py index 6d8606113..58d8cc9c4 100644 --- a/nova/network/floating_ips.py +++ b/nova/network/floating_ips.py @@ -92,8 +92,6 @@ class FloatingIP(object): instance_uuid = kwargs.get('instance_uuid') project_id = kwargs.get('project_id') requested_networks = kwargs.get('requested_networks') - LOG.debug(_("floating IP allocation for instance |%s|"), - instance_uuid=instance_uuid, context=context) # call the next inherited class's allocate_for_instance() # which is currently the NetworkManager version # do this first so fixed ip is already allocated @@ -103,6 +101,9 @@ class FloatingIP(object): # allocate a floating ip floating_address = self.allocate_floating_ip(context, project_id, True) + LOG.debug(_("floating IP allocation for instance " + "|%(floating_address)s|") % locals(), + instance_uuid=instance_uuid, context=context) # set auto_assigned column to true for the floating ip self.db.floating_ip_set_auto_assigned(context, floating_address) diff --git a/nova/network/manager.py b/nova/network/manager.py index 0bd652cdd..4da821ffb 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -495,7 +495,9 @@ class NetworkManager(manager.SchedulerDependentManager): networks = self._get_networks_for_instance(admin_context, instance_id, project_id, requested_networks=requested_networks) - LOG.debug(_('networks retrieved for instance: |%(networks)s|'), + networks_list = [self._get_network_dict(network) + for network in networks] + LOG.debug(_('networks retrieved for instance: |%(networks_list)s|'), locals(), context=context, instance_uuid=instance_uuid) self._allocate_mac_addresses(context, instance_uuid, networks) self._allocate_fixed_ips(admin_context, instance_id, |