From: Philipp Marek Date: Tue, 10 Feb 2015 09:07:53 +0000 (+0100) Subject: DRBD: Use correct function object after DBus disconnect. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=1c061402a22e409bd83d4922af90ee7718a9b901;p=openstack-build%2Fcinder-build.git DRBD: Use correct function object after DBus disconnect. When the DRBDmanage daemon gets restarted in some way, the DBus object used is no longer valid. But it's not enough to get a new object; the function got invalid, too, so it has to be fetched anew. Closes-Bug: #1420171 Change-Id: Ie4734d8e3a183957c1f9421a5794f9ef962650b7 --- diff --git a/cinder/volume/drivers/drbdmanagedrv.py b/cinder/volume/drivers/drbdmanagedrv.py index b1b67396d..e6ee690a3 100644 --- a/cinder/volume/drivers/drbdmanagedrv.py +++ b/cinder/volume/drivers/drbdmanagedrv.py @@ -113,12 +113,13 @@ class DrbdManageDriver(driver.VolumeDriver): try once to reconnect. """ try: - return apply(fn, args) + return fn(*args) except dbus.DBusException as e: LOG.warn(_LW("got disconnected; trying to reconnect. (%s)") % six.text_type(e)) self.dbus_connect() - return apply(fn, args) + # Old function object is invalid, get new one. + return getattr(self.odm, fn._method_name)(*args) def do_setup(self, context): """Any initialization the volume driver does while starting."""