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
This commit is contained in:
Walter A. Boring IV 2013-12-09 11:58:40 -08:00
parent 0f24cf91e1
commit a83506d170
1 changed files with 12 additions and 2 deletions

View File

@ -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: