]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Revert "Brick connector fix for NFS drivers"
authorJohn Griffith <john.griffith@solidfire.com>
Thu, 24 Oct 2013 23:35:16 +0000 (23:35 +0000)
committerJohn Griffith <john.griffith@solidfire.com>
Fri, 25 Oct 2013 16:16:10 +0000 (10:16 -0600)
This reverts commit b6b9df2940ac07f715f759f4c315b2cf088c2320

Passing in driver=self in the base driver connector builder breaks all of the other drivers and isn't the *correct* driver to be passing in.

Simply removing this fixes the functionality, however breaks your tests and I'm not sure of the impact on what you were attempting so I'm reverting.

Change-Id: I0af85a2bc491cc0e23aa6af1f67c2dfed1c7081f

cinder/brick/initiator/connector.py
cinder/tests/test_coraid.py
cinder/volume/driver.py
cinder/volume/drivers/nfs.py

index d61b718800c3d8b2952f2a8c401e35370d88bc69..0778f946bba114e67ea5657ceceb8be2ddd1825a 100644 (file)
@@ -797,15 +797,6 @@ class RemoteFsConnector(InitiatorConnector):
                  execute=putils.execute,
                  device_scan_attempts=DEVICE_SCAN_ATTEMPTS_DEFAULT,
                  *args, **kwargs):
-        if mount_type.lower() == 'nfs':
-            if driver:
-                kwargs = kwargs or {}
-                kwargs['nfs_mount_point_base'] =\
-                    kwargs.get('nfs_mount_point_base') or\
-                    getattr(driver, 'base', None)
-            else:
-                LOG.warn(_("NFS volume driver is absent."
-                           " RemoteFsClient may not initialize properly."))
         self._remotefsclient = remotefs.RemoteFsClient(mount_type, root_helper,
                                                        execute=execute,
                                                        *args, **kwargs)
@@ -831,8 +822,7 @@ class RemoteFsConnector(InitiatorConnector):
         """
 
         mnt_flags = []
-        if ('options' in connection_properties and
-                connection_properties['options']):
+        if 'options' in connection_properties:
             mnt_flags = connection_properties['options'].split()
 
         nfs_share = connection_properties['export']
index 67394995c8b2421e594890ec6867e9e5aabe29fc..277ba6ef7a88839224a1db48e223754ab3f89035 100644 (file)
@@ -785,7 +785,7 @@ class CoraidDriverImageTestCases(CoraidDriverTestCase):
 
         aoe_initiator = self.mox.CreateMockAnything()
 
-        utils.brick_get_connector('aoe', driver=mox.IgnoreArg(),
+        utils.brick_get_connector('aoe',
                                   device_scan_attempts=3,
                                   use_multipath=False).\
             AndReturn(aoe_initiator)
index baba887f0ce40c2395e194b4385da8e137eb8014..226fbef20e67ccdf2a7393479b55e18ef200e484 100644 (file)
@@ -371,7 +371,6 @@ class VolumeDriver(object):
         device_scan_attempts = self.configuration.num_volume_device_scan_tries
         protocol = conn['driver_volume_type']
         connector = utils.brick_get_connector(protocol,
-                                              driver=self,
                                               use_multipath=use_multipath,
                                               device_scan_attempts=
                                               device_scan_attempts)
index bf56a19b2079fa9286ab399fa53fcb08580843ad..277b173a6495772be6ab5b6b043f8fd37c0bc46a 100644 (file)
@@ -373,15 +373,15 @@ class NfsDriver(RemoteFsDriver):
         super(NfsDriver, self).__init__(*args, **kwargs)
         self.configuration.append_config_values(volume_opts)
         root_helper = utils.get_root_helper()
-        self.base = getattr(self.configuration,
-                            'nfs_mount_point_base',
-                            CONF.nfs_mount_point_base)
+        base = getattr(self.configuration,
+                       'nfs_mount_point_base',
+                       CONF.nfs_mount_point_base)
         opts = getattr(self.configuration,
                        'nfs_mount_options',
                        CONF.nfs_mount_options)
         self._remotefsclient = remotefs.RemoteFsClient(
             'nfs', root_helper, execute=execute,
-            nfs_mount_point_base=self.base,
+            nfs_mount_point_base=base,
             nfs_mount_options=opts)
 
     def set_execute(self, execute):