From 206b1413e49c2dcf6fcaa1db9b8f877ead18aabc Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Fri, 6 Nov 2015 12:00:18 -0800 Subject: [PATCH] Properly log BlockDeviceMappingList in _create_block_device_mapping The block_device_mapping list parameter is a BlockDeviceMappingList object, and list objects don't repr the sub-objects so it's useless information in the logs. Cast to a list to get the sub-objects repr'ed in the logs. The bdm list of dicts from the API request is converted to a BlockDeviceMappingList in _check_and_transform_bdm which is called from _create_instance before _create_block_device_mapping. Closes-Bug: #1513934 Change-Id: Id709c0bc9d0ad980d0b36973f3a52034003170af --- nova/compute/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/compute/api.py b/nova/compute/api.py index 9eda90103371..32d1b4b6b6fa 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1269,7 +1269,7 @@ class API(base.Base): This method makes a copy of the list in order to avoid using the same id field in case this is called for multiple instances. """ - LOG.debug("block_device_mapping %s", block_device_mapping, + LOG.debug("block_device_mapping %s", list(block_device_mapping), instance_uuid=instance_uuid) instance_block_device_mapping = copy.deepcopy(block_device_mapping) for bdm in instance_block_device_mapping: