From: Walter A. Boring IV Date: Mon, 9 Dec 2013 19:58:40 +0000 (-0800) Subject: Add the driver name to get stats log output X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a83506d170e90b111b7e63fab9f585883971f316;p=openstack-build%2Fcinder-build.git Add the driver name to get stats log output When the manager call tries to update the driver stats, it checks to ensure the driver is initialized. When the driver hasn't been initialized, it logs a warning without the driver name. This is confusing for multiple backends. This patch adds the driver name, version and the config group name, to the log output, so the admin can see which driver is failing. Change-Id: I82e8aa969e7baa55db9c8dddc1c08db2a1a41091 Closes-Bug: #1259279 --- diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index a0f4e071d..14377a0b3 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -888,8 +888,18 @@ class VolumeManager(manager.SchedulerDependentManager): def _report_driver_status(self, context): LOG.info(_("Updating volume status")) if not self.driver.initialized: - LOG.warning(_('Unable to update stats, driver is ' - 'uninitialized')) + if self.driver.configuration.config_group is None: + config_group = '' + else: + config_group = ('(config name %s)' % + self.driver.configuration.config_group) + + LOG.warning(_('Unable to update stats, %(driver_name)s ' + '-%(driver_version)s ' + '%(config_group)s driver is uninitialized.') % + {'driver_name': self.driver.__class__.__name__, + 'driver_version': self.driver.get_version(), + 'config_group': config_group}) else: volume_stats = self.driver.get_volume_stats(refresh=True) if volume_stats: