From 915aa5c8d6d40474aa6ee529a1aaeb5d14a045c8 Mon Sep 17 00:00:00 2001 From: Silvan Kaiser Date: Thu, 26 Nov 2015 14:23:06 +0100 Subject: [PATCH] Add quobyte protocol for remotefs connections Adds the quobyte protocol alongside nfs, glusterfs, etc. . Closes-Bug: #1520207 Change-Id: Ieaf37640b0f4cc21c22cfd836c87f03e91da1564 --- os_brick/initiator/connector.py | 5 +++-- os_brick/remotefs/remotefs.py | 3 ++- os_brick/tests/initiator/test_connector.py | 4 ++++ os_brick/tests/remotefs/test_remotefs.py | 3 +++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/os_brick/initiator/connector.py b/os_brick/initiator/connector.py index 8e79d70e8..7a8d67675 100644 --- a/os_brick/initiator/connector.py +++ b/os_brick/initiator/connector.py @@ -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) diff --git a/os_brick/remotefs/remotefs.py b/os_brick/remotefs/remotefs.py index bd336c11b..4f6b5e226 100644 --- a/os_brick/remotefs/remotefs.py +++ b/os_brick/remotefs/remotefs.py @@ -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: diff --git a/os_brick/tests/initiator/test_connector.py b/os_brick/tests/initiator/test_connector.py index adb30470c..53dbab4cd 100644 --- a/os_brick/tests/initiator/test_connector.py +++ b/os_brick/tests/initiator/test_connector.py @@ -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) diff --git a/os_brick/tests/remotefs/test_remotefs.py b/os_brick/tests/remotefs/test_remotefs.py index 8e7ea415e..9751c1b08 100644 --- a/os_brick/tests/remotefs/test_remotefs.py +++ b/os_brick/tests/remotefs/test_remotefs.py @@ -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,