From: Walter A. Boring IV Date: Mon, 30 Sep 2013 22:45:28 +0000 (-0700) Subject: Pass through args and kwargs in brick connectors X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a86e12aad5466bf6c8027f2a76811c99a010f273;p=openstack-build%2Fcinder-build.git Pass through args and kwargs in brick connectors 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 --- diff --git a/cinder/brick/initiator/connector.py b/cinder/brick/initiator/connector.py index d950575d0..0778f946b 100644 --- a/cinder/brick/initiator/connector.py +++ b/cinder/brick/initiator/connector.py @@ -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=