From 19191c9ed139876fb54cd2cff7991a2950a187da Mon Sep 17 00:00:00 2001 From: Li Min Liu Date: Sun, 1 Feb 2015 23:22:43 +0800 Subject: [PATCH] Make storwize debug log more readable Use volume id instead of volume object in debug log. Change-Id: Ie16d6fefdfffe9d52c0c05bc904142a36e725bf4 --- .../drivers/ibm/storwize_svc/__init__.py | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/cinder/volume/drivers/ibm/storwize_svc/__init__.py b/cinder/volume/drivers/ibm/storwize_svc/__init__.py index 8649ba19c..d2d70cc61 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/__init__.py +++ b/cinder/volume/drivers/ibm/storwize_svc/__init__.py @@ -337,8 +337,8 @@ class StorwizeSVCDriver(san.SanDriver): """ - LOG.debug('enter: initialize_connection: volume %(vol)s with ' - 'connector %(conn)s' % {'vol': volume, 'conn': connector}) + LOG.debug('enter: initialize_connection: volume %(vol)s with connector' + ' %(conn)s', {'vol': volume['id'], 'conn': connector}) vol_opts = self._get_vdisk_params(volume['volume_type_id']) volume_name = volume['name'] @@ -491,12 +491,13 @@ class StorwizeSVCDriver(san.SanDriver): LOG.error(_LE('initialize_connection: Failed ' 'to collect return ' 'properties for volume %(vol)s and connector ' - '%(conn)s.\n') % {'vol': volume, - 'conn': connector}) + '%(conn)s.\n'), {'vol': volume, + 'conn': connector}) LOG.debug('leave: initialize_connection:\n volume: %(vol)s\n ' - 'connector %(conn)s\n properties: %(prop)s' - % {'vol': volume, 'conn': connector, 'prop': properties}) + 'connector %(conn)s\n properties: %(prop)s', + {'vol': volume['id'], 'conn': connector, + 'prop': properties}) return {'driver_volume_type': type_str, 'data': properties, } @@ -522,8 +523,8 @@ class StorwizeSVCDriver(san.SanDriver): 3. Delete the host if it has no more mappings (hosts are created automatically by this driver when mappings are created) """ - LOG.debug('enter: terminate_connection: volume %(vol)s with ' - 'connector %(conn)s' % {'vol': volume, 'conn': connector}) + LOG.debug('enter: terminate_connection: volume %(vol)s with connector' + ' %(conn)s', {'vol': volume['id'], 'conn': connector}) vol_name = volume['name'] if 'host' in connector: @@ -558,7 +559,8 @@ class StorwizeSVCDriver(san.SanDriver): self._helpers.unmap_vol_from_host(vol_name, host_name) LOG.debug('leave: terminate_connection: volume %(vol)s with ' - 'connector %(conn)s' % {'vol': volume, 'conn': connector}) + 'connector %(conn)s', {'vol': volume['id'], + 'conn': connector}) return info -- 2.45.2