]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Pass through args and kwargs in brick connectors
authorWalter A. Boring IV <walter.boring@hp.com>
Mon, 30 Sep 2013 22:45:28 +0000 (15:45 -0700)
committerChet Burgess <cfb@metacloud.com>
Tue, 1 Oct 2013 23:24:16 +0000 (16:24 -0700)
This is a change needed to help remove CONF usage
in the brick/remotefs/RemoteFsClient.
RemoteFsClient can then pull the values from the caller.

Change-Id: Ie1ff2a39b92c4150fec4a3191367797a260b30ec
Partial-Bug: #1230066

cinder/brick/initiator/connector.py

index d950575d0822404c90aa357395d3a7fcace6813a..0778f946bba114e67ea5657ceceb8be2ddd1825a 100644 (file)
@@ -79,7 +79,8 @@ class InitiatorConnector(executor.Executor):
     @staticmethod
     def factory(protocol, root_helper, driver=None,
                 execute=putils.execute, use_multipath=False,
-                device_scan_attempts=DEVICE_SCAN_ATTEMPTS_DEFAULT):
+                device_scan_attempts=DEVICE_SCAN_ATTEMPTS_DEFAULT,
+                *args, **kwargs):
         """Build a Connector object based upon protocol."""
         LOG.debug("Factory for %s" % protocol)
         protocol = protocol.upper()
@@ -88,30 +89,35 @@ class InitiatorConnector(executor.Executor):
                                   driver=driver,
                                   execute=execute,
                                   use_multipath=use_multipath,
-                                  device_scan_attempts=device_scan_attempts)
+                                  device_scan_attempts=device_scan_attempts,
+                                  *args, **kwargs)
         elif protocol == "FIBRE_CHANNEL":
             return FibreChannelConnector(root_helper=root_helper,
                                          driver=driver,
                                          execute=execute,
                                          use_multipath=use_multipath,
                                          device_scan_attempts=
-                                         device_scan_attempts)
+                                         device_scan_attempts,
+                                         *args, **kwargs)
         elif protocol == "AOE":
             return AoEConnector(root_helper=root_helper,
                                 driver=driver,
                                 execute=execute,
-                                device_scan_attempts=device_scan_attempts)
+                                device_scan_attempts=device_scan_attempts,
+                                *args, **kwargs)
         elif protocol == "NFS" or protocol == "GLUSTERFS":
             return RemoteFsConnector(mount_type=protocol.lower(),
                                      root_helper=root_helper,
                                      driver=driver,
                                      execute=execute,
-                                     device_scan_attempts=device_scan_attempts)
+                                     device_scan_attempts=device_scan_attempts,
+                                     *args, **kwargs)
         elif protocol == "LOCAL":
             return LocalConnector(root_helper=root_helper,
                                   driver=driver,
                                   execute=execute,
-                                  device_scan_attempts=device_scan_attempts)
+                                  device_scan_attempts=device_scan_attempts,
+                                  *args, **kwargs)
         else:
             msg = (_("Invalid InitiatorConnector protocol "
                      "specified %(protocol)s") %
@@ -792,7 +798,8 @@ class RemoteFsConnector(InitiatorConnector):
                  device_scan_attempts=DEVICE_SCAN_ATTEMPTS_DEFAULT,
                  *args, **kwargs):
         self._remotefsclient = remotefs.RemoteFsClient(mount_type, root_helper,
-                                                       execute=execute)
+                                                       execute=execute,
+                                                       *args, **kwargs)
         super(RemoteFsConnector, self).__init__(root_helper, driver=driver,
                                                 execute=execute,
                                                 device_scan_attempts=