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