From 1fda615f6fc87973cacb9a0685d599b552c8a013 Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Tue, 16 Feb 2016 22:15:29 +0100 Subject: [PATCH] glusterfs_native: relocate module under glusterfs Having a driver in the top level of the drivers directory was against source tree placement conventions. It was especially weird because all other GlusterFS related code lived in a dedicated subdirectory. Partially implements bp gluster-code-cleanup Change-Id: I52d717ab6396454c2e7a9b62aa00ea443b26d5cc --- doc/source/devref/glusterfs_native_driver.rst | 8 ++++---- etc/manila/rootwrap.d/share.filters | 8 ++++---- manila/share/drivers/{ => glusterfs}/glusterfs_native.py | 0 manila/share/manager.py | 3 +++ .../drivers/{ => glusterfs}/test_glusterfs_native.py | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) rename manila/share/drivers/{ => glusterfs}/glusterfs_native.py (100%) rename manila/tests/share/drivers/{ => glusterfs}/test_glusterfs_native.py (99%) diff --git a/doc/source/devref/glusterfs_native_driver.rst b/doc/source/devref/glusterfs_native_driver.rst index d298af72b1..0c64cd8f70 100644 --- a/doc/source/devref/glusterfs_native_driver.rst +++ b/doc/source/devref/glusterfs_native_driver.rst @@ -72,7 +72,7 @@ Manila driver configuration setting The following parameters in manila's configuration file need to be set: - `share_driver` = - manila.share.drivers.glusterfs_native.GlusterfsNativeShareDriver + manila.share.drivers.glusterfs.glusterfs_native.GlusterfsNativeShareDriver - `glusterfs_servers` = List of GlusterFS servers which provide volumes that can be used to create shares. The servers are expected to be of distinct Gluster clusters (ie. should not be gluster peers). Each server @@ -138,10 +138,10 @@ Known Restrictions - For manila to use GlusterFS volumes, the name of the trashcan directory in GlusterFS volumes must not be changed from the default. -The :mod:`manila.share.drivers.glusterfs_native.GlusterfsNativeShareDriver` Module -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The :mod:`manila.share.drivers.glusterfs.glusterfs_native.GlusterfsNativeShareDriver` Module +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. automodule:: manila.share.drivers.glusterfs_native +.. automodule:: manila.share.drivers.glusterfs.glusterfs_native :noindex: :members: :undoc-members: diff --git a/etc/manila/rootwrap.d/share.filters b/etc/manila/rootwrap.d/share.filters index 197cbcd710..0e53633fd6 100644 --- a/etc/manila/rootwrap.d/share.filters +++ b/etc/manila/rootwrap.d/share.filters @@ -59,7 +59,7 @@ mkdir: CommandFilter, mkdir, root rm: CommandFilter, rm, root # manila/share/drivers/glusterfs.py: 'mount', '-t', 'glusterfs', '%s', '%s' -# manila/share/drivers/glusterfs_native.py: 'mount', '-t', 'glusterfs', '%s', '%s' +# manila/share/drivers/glusterfs/glusterfs_native.py: 'mount', '-t', 'glusterfs', '%s', '%s' mount: CommandFilter, mount, root # manila/share/drivers/glusterfs.py: 'gluster', '--xml', 'volume', 'info', '%s' @@ -72,11 +72,11 @@ ip: CommandFilter, ip, root # manila/network/linux/interface.py: 'ovs-vsctl', 'add-port', '%s', '%s' ovs-vsctl: CommandFilter, ovs-vsctl, root -# manila/share/drivers/glusterfs_native.py: 'find', '%s', '-mindepth', '1', '!', '-path', '%s', '!', '-path', '%s', '-delete' -# manila/share/drivers/glusterfs_native.py: 'find', '%s', '-mindepth', '1', '-delete' +# manila/share/drivers/glusterfs/glusterfs_native.py: 'find', '%s', '-mindepth', '1', '!', '-path', '%s', '!', '-path', '%s', '-delete' +# manila/share/drivers/glusterfs/glusterfs_native.py: 'find', '%s', '-mindepth', '1', '-delete' find: CommandFilter, find, root -# manila/share/drivers/glusterfs_native.py: 'umount', '%s' +# manila/share/drivers/glusterfs/glusterfs_native.py: 'umount', '%s' umount: CommandFilter, umount, root # GPFS commands diff --git a/manila/share/drivers/glusterfs_native.py b/manila/share/drivers/glusterfs/glusterfs_native.py similarity index 100% rename from manila/share/drivers/glusterfs_native.py rename to manila/share/drivers/glusterfs/glusterfs_native.py diff --git a/manila/share/manager.py b/manila/share/manager.py index 4ca1ac13cd..fc7d26ab57 100644 --- a/manila/share/manager.py +++ b/manila/share/manager.py @@ -107,6 +107,9 @@ MAPPING = { 'manila.share.drivers.netapp.common.NetAppDriver', 'manila.share.drivers.hp.hp_3par_driver.HP3ParShareDriver': 'manila.share.drivers.hpe.hpe_3par_driver.HPE3ParShareDriver', + 'manila.share.drivers.glusterfs_native.GlusterfsNativeShareDriver': + 'manila.share.drivers.glusterfs.glusterfs_native.' + 'GlusterfsNativeShareDriver', } QUOTAS = quota.QUOTAS diff --git a/manila/tests/share/drivers/test_glusterfs_native.py b/manila/tests/share/drivers/glusterfs/test_glusterfs_native.py similarity index 99% rename from manila/tests/share/drivers/test_glusterfs_native.py rename to manila/tests/share/drivers/glusterfs/test_glusterfs_native.py index 13f11ea35a..893ed2fd3b 100644 --- a/manila/tests/share/drivers/test_glusterfs_native.py +++ b/manila/tests/share/drivers/glusterfs/test_glusterfs_native.py @@ -27,7 +27,7 @@ from manila import context from manila import exception from manila.share import configuration as config from manila.share.drivers.glusterfs import common -from manila.share.drivers import glusterfs_native +from manila.share.drivers.glusterfs import glusterfs_native from manila import test from manila.tests import fake_utils