From 7d585b2cdc5f593b293c9e3b150ebf68e547b094 Mon Sep 17 00:00:00 2001 From: Wangpan Date: Mon, 4 Feb 2013 11:45:14 +0800 Subject: 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 "|[]|", 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 --- nova/network/floating_ips.py | 5 +++-- 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, -- cgit