From: Philipp Marek Date: Mon, 19 Jan 2015 13:29:57 +0000 (+0100) Subject: DRBD: Log an error if libraries can't be loaded X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=fbab2de3559d7eab854e315fbe10988c7062f703;p=openstack-build%2Fcinder-build.git DRBD: Log an error if libraries can't be loaded Having a meaningful error message is better than a backtrace. Change-Id: I0631228228db06efdedd65a44a286824b34e0b1a --- diff --git a/cinder/volume/drivers/drbdmanagedrv.py b/cinder/volume/drivers/drbdmanagedrv.py index a87f66371..6d89512c8 100644 --- a/cinder/volume/drivers/drbdmanagedrv.py +++ b/cinder/volume/drivers/drbdmanagedrv.py @@ -127,6 +127,11 @@ class DrbdManageDriver(driver.VolumeDriver): def check_for_setup_error(self): """Verify that requirements are in place to use DRBDmanage driver.""" + if not all((dbus, dm_exc, dm_const, dm_utils)): + msg = _('DRBDmanage driver setup error: some required ' + 'libraries (dbus, drbdmanage.*) not found.') + LOG.error(msg) + raise exception.VolumeDriverException(message=msg) if self.odm.ping() != 0: message = _('Cannot ping DRBDmanage backend') raise exception.VolumeBackendAPIException(data=message)