]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Isolate Cinder Attach and Connect in Base Driver
authorJohn Griffith <john.griffith@solidfire.com>
Mon, 15 Dec 2014 22:59:12 +0000 (22:59 +0000)
committerJohn Griffith <john.griffith@solidfire.com>
Wed, 17 Dec 2014 16:01:44 +0000 (09:01 -0700)
The base Cinder Driver combines the Attach process and the
actual Connect process all under the Attach method.  This makes
sense, but the method can be split between the parts that perform
things like DB updates and RPC calls and those that just take iqn
info and actually make connections to the Cinder Volume Node.

This would allow Drivers to utilize the connector portion of the
code to add enhancements of their own.

Change-Id: I9e3cd24dc978e7c7672bf1eb09626428d2ba144d

cinder/volume/driver.py

index 48611512f42c07ae2672b93b85b02bc992b92705..cbe98e70189cec6ca4e69c829dc11044b843bb95 100755 (executable)
@@ -496,7 +496,9 @@ class VolumeDriver(object):
                     LOG.error(err_msg)
                     raise exception.VolumeBackendAPIException(data=ex_msg)
                 raise exception.VolumeBackendAPIException(data=err_msg)
+        return self._connect_device(conn)
 
+    def _connect_device(self, conn):
         # Use Brick's code to do attach/detach
         use_multipath = self.configuration.use_multipath_for_image_xfer
         device_scan_attempts = self.configuration.num_volume_device_scan_tries