Skip to content

Commit

Permalink
Pass through args and kwargs in brick connectors
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hemna authored and Chet Burgess committed Oct 1, 2013
1 parent 7018256 commit a86e12a
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions cinder/brick/initiator/connector.py
Expand Up @@ -79,7 +79,8 @@ def set_driver(self, driver):
@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()
Expand All @@ -88,30 +89,35 @@ def factory(protocol, root_helper, driver=None,
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") %
Expand Down Expand Up @@ -792,7 +798,8 @@ def __init__(self, mount_type, root_helper, driver=None,
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=
Expand Down

0 comments on commit a86e12a

Please sign in to comment.