Add quobyte protocol for remotefs connections

Adds the quobyte protocol alongside nfs, glusterfs, etc. .

Closes-Bug: #1520207

Change-Id: Ieaf37640b0f4cc21c22cfd836c87f03e91da1564
This commit is contained in:
Silvan Kaiser 2015-11-26 14:23:06 +01:00
parent ebec620bb5
commit 915aa5c8d6
4 changed files with 12 additions and 3 deletions

View File

@ -74,6 +74,7 @@ HGST = "HGST"
RBD = "RBD"
SCALEIO = "SCALEIO"
SCALITY = "SCALITY"
QUOBYTE = "QUOBYTE"
def _check_multipathd_running(root_helper, enforce_multipath):
@ -194,7 +195,7 @@ class InitiatorConnector(executor.Executor):
execute=execute,
device_scan_attempts=device_scan_attempts,
*args, **kwargs)
elif protocol in (NFS, GLUSTERFS, SCALITY):
elif protocol in (NFS, GLUSTERFS, SCALITY, QUOBYTE):
return RemoteFsConnector(mount_type=protocol.lower(),
root_helper=root_helper,
driver=driver,
@ -1538,7 +1539,7 @@ class RemoteFsConnector(InitiatorConnector):
if conn:
mount_point_base = conn.get('mount_point_base')
mount_type_lower = mount_type.lower()
if mount_type_lower in ('nfs', 'glusterfs', 'scality'):
if mount_type_lower in ('nfs', 'glusterfs', 'scality', 'quobyte'):
kwargs[mount_type_lower + '_mount_point_base'] = (
kwargs.get(mount_type_lower + '_mount_point_base') or
mount_point_base)

View File

@ -40,7 +40,8 @@ class RemoteFsClient(object):
'cifs': 'smbfs',
'glusterfs': 'glusterfs',
'vzstorage': 'vzstorage',
'scality': 'scality_sofs'
'scality': 'scality_sofs',
'quobyte': 'quobyte'
}
if mount_type not in mount_type_to_option_prefix:

View File

@ -171,6 +171,10 @@ class ConnectorTestCase(base.TestCase):
obj = connector.InitiatorConnector.factory("scaleio", None)
self.assertEqual("ScaleIOConnector", obj.__class__.__name__)
obj = connector.InitiatorConnector.factory(
'quobyte', None, quobyte_mount_point_base='/mnt/test')
self.assertEqual(obj.__class__.__name__, "RemoteFsConnector")
self.assertRaises(ValueError,
connector.InitiatorConnector.factory,
"bogus", None)

View File

@ -177,6 +177,9 @@ class RemoteFsClientTestCase(base.TestCase):
def test_no_mount_point_scality(self):
self._test_no_mount_point('scality')
def test_no_mount_point_quobyte(self):
self._test_no_mount_point('quobyte')
def test_invalid_fs(self):
self.assertRaises(exception.ProtocolNotSupported,
remotefs.RemoteFsClient,