]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
DRBD: Use correct function object after DBus disconnect.
authorPhilipp Marek <philipp.marek@linbit.com>
Tue, 10 Feb 2015 09:07:53 +0000 (10:07 +0100)
committerPhilipp Marek <philipp.marek@linbit.com>
Tue, 10 Feb 2015 09:07:53 +0000 (10:07 +0100)
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

cinder/volume/drivers/drbdmanagedrv.py

index b1b67396db66372e4130fb62b65391aaa91db8d3..e6ee690a3e7ccb60b58e4b2d9a038ced167275a0 100644 (file)
@@ -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."""