Ramesh N has uploaded a new change for review. Change subject: Move gluster.exception to lib/vdsm/gluster ......................................................................
Move gluster.exception to lib/vdsm/gluster Change-Id: Ib97d2728c97d295b83ed452e116e9422184de10f Signed-off-by: Ramesh Nachimuthu <[email protected]> --- M configure.ac M lib/vdsm/Makefile.am A lib/vdsm/gluster/Makefile.am A lib/vdsm/gluster/__init__.py R lib/vdsm/gluster/exception.py M lib/vdsm/rpc/Bridge.py M tests/gluster_exception_test.py M tests/storageServerTests.py M vdsm.spec.in M vdsm/gluster/Makefile.am M vdsm/gluster/api.py M vdsm/gluster/cli.py M vdsm/gluster/fstab.py M vdsm/gluster/gfapi.py M vdsm/gluster/hooks.py M vdsm/gluster/services.py M vdsm/gluster/storagedev.py M vdsm/gluster/tasks.py M vdsm/storage/glusterVolume.py M vdsm/storage/storageServer.py 20 files changed, 59 insertions(+), 17 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/61019/1 diff --git a/configure.ac b/configure.ac index a953b3e..55d8b70 100644 --- a/configure.ac +++ b/configure.ac @@ -409,6 +409,7 @@ lib/vdsm/tool/configurators/Makefile lib/api/Makefile lib/yajsonrpc/Makefile + lib/vdsm/gluster/Makefile lib/vdsm/host/Makefile lib/vdsm/network/Makefile lib/vdsm/network/configurators/Makefile diff --git a/lib/vdsm/Makefile.am b/lib/vdsm/Makefile.am index a9680c0..3e3fa68 100644 --- a/lib/vdsm/Makefile.am +++ b/lib/vdsm/Makefile.am @@ -19,7 +19,7 @@ # include $(top_srcdir)/build-aux/Makefile.subs -SUBDIRS=common tool profiling rpc network virt storage host metrics +SUBDIRS=common tool profiling rpc network virt storage host metrics gluster dist_vdsmpylib_PYTHON = \ __init__.py \ diff --git a/lib/vdsm/gluster/Makefile.am b/lib/vdsm/gluster/Makefile.am new file mode 100644 index 0000000..cd1e427 --- /dev/null +++ b/lib/vdsm/gluster/Makefile.am @@ -0,0 +1,18 @@ +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# + +include $(top_srcdir)/build-aux/Makefile.subs + +vdsmglusterdir = $(vdsmpylibdir)/gluster + +common = \ + __init__.py \ + exception.py \ + $(NULL) + +dist_vdsmgluster_PYTHON = $(common) diff --git a/lib/vdsm/gluster/__init__.py b/lib/vdsm/gluster/__init__.py new file mode 100644 index 0000000..4a67f47 --- /dev/null +++ b/lib/vdsm/gluster/__init__.py @@ -0,0 +1,19 @@ +# Copyright 2016 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Refer to the README and COPYING files for full details of the license +# +from __future__ import absolute_import diff --git a/vdsm/gluster/exception.py b/lib/vdsm/gluster/exception.py similarity index 99% rename from vdsm/gluster/exception.py rename to lib/vdsm/gluster/exception.py index 1e1b961..43ad1da 100644 --- a/vdsm/gluster/exception.py +++ b/lib/vdsm/gluster/exception.py @@ -29,6 +29,8 @@ # IMPORTANT NOTE: USE CODES BETWEEN 4100 AND 4800 # ######################################################## +# +from __future__ import absolute_import from vdsm.exception import VdsmException diff --git a/lib/vdsm/rpc/Bridge.py b/lib/vdsm/rpc/Bridge.py index d2880cd..70da6b7 100644 --- a/lib/vdsm/rpc/Bridge.py +++ b/lib/vdsm/rpc/Bridge.py @@ -32,7 +32,7 @@ try: import gluster.apiwrapper as gapi - import gluster.exception as ge + from vdsm.gluster import exception as ge _glusterEnabled = True except ImportError: _glusterEnabled = False diff --git a/tests/gluster_exception_test.py b/tests/gluster_exception_test.py index d742f36..eb652ae 100644 --- a/tests/gluster_exception_test.py +++ b/tests/gluster_exception_test.py @@ -19,8 +19,8 @@ # from testlib import VdsmTestCase -from gluster import exception as gluster_exception -from gluster.exception import GlusterException +from vdsm.gluster import exception as gluster_exception +from vdsm.gluster.exception import GlusterException class TestGlusterException(VdsmTestCase): diff --git a/tests/storageServerTests.py b/tests/storageServerTests.py index bd1534a..056a359 100644 --- a/tests/storageServerTests.py +++ b/tests/storageServerTests.py @@ -20,7 +20,7 @@ from monkeypatch import MonkeyPatch import gluster.cli -import gluster.exception as ge +from vdsm.gluster import exception as ge from testlib import permutations, expandPermutations from testlib import VdsmTestCase from storage.storageServer import GlusterFSConnection diff --git a/vdsm.spec.in b/vdsm.spec.in index e402cde..ac18c41 100644 --- a/vdsm.spec.in +++ b/vdsm.spec.in @@ -1091,9 +1091,11 @@ %{_datadir}/%{vdsm_name}/get-conf-item %{_datadir}/%{vdsm_name}/set-conf-item %dir %{_datadir}/%{vdsm_name}/gluster +%dir %{python_sitelib}/%{vdsm_name}/gluster %{_datadir}/%{vdsm_name}/gluster/__init__.py* %{_datadir}/%{vdsm_name}/gluster/cli.py* -%{_datadir}/%{vdsm_name}/gluster/exception.py* +%{python_sitelib}/%{vdsm_name}/gluster/exception.py* +%{python_sitelib}/%{vdsm_name}/gluster/__init__.py* %{python_sitelib}/sos/plugins/vdsm.py* %{_udevrulesdir}/12-vdsm-lvm.rules /etc/security/limits.d/99-vdsm.conf @@ -1643,6 +1645,7 @@ %defattr(-, root, root, -) %dir %{_datadir}/%{vdsm_name} %dir %{_datadir}/%{vdsm_name}/gluster +%dir %{python_sitelib}/%{vdsm_name}/gluster %dir %{python_sitelib}/%{vdsm_name} %dir %{python_sitelib}/%{vdsm_name}/rpc %license COPYING diff --git a/vdsm/gluster/Makefile.am b/vdsm/gluster/Makefile.am index a811ad0..fdb0020 100644 --- a/vdsm/gluster/Makefile.am +++ b/vdsm/gluster/Makefile.am @@ -25,7 +25,6 @@ common = \ __init__.py \ cli.py \ - exception.py $(NULL) if GLUSTER_MGMT diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py index b6f11c3..b0b1689 100644 --- a/vdsm/gluster/api.py +++ b/vdsm/gluster/api.py @@ -31,7 +31,7 @@ from vdsm import supervdsm as svdsm from pwd import getpwnam -import exception as ge +from vdsm.gluster import exception as ge from . import gluster_mgmt_api from . import safeWrite import fstab diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py index 87ee752..e8d0828 100644 --- a/vdsm/gluster/cli.py +++ b/vdsm/gluster/cli.py @@ -28,7 +28,7 @@ from vdsm import commands from vdsm import utils from vdsm.network.netinfo import addresses -import exception as ge +from vdsm.gluster import exception as ge from . import gluster_mgmt_api, gluster_api _glusterCommandPath = utils.CommandPath("gluster", diff --git a/vdsm/gluster/fstab.py b/vdsm/gluster/fstab.py index 5a2b4c8..ac5ca4f 100644 --- a/vdsm/gluster/fstab.py +++ b/vdsm/gluster/fstab.py @@ -22,7 +22,7 @@ import os from collections import namedtuple -import exception as ge +from vdsm.gluster import exception as ge from . import safeWrite diff --git a/vdsm/gluster/gfapi.py b/vdsm/gluster/gfapi.py index 83a5c57..059e76b 100644 --- a/vdsm/gluster/gfapi.py +++ b/vdsm/gluster/gfapi.py @@ -21,7 +21,7 @@ from ctypes.util import find_library import os -import exception as ge +from vdsm.gluster import exception as ge from . import gluster_mgmt_api diff --git a/vdsm/gluster/hooks.py b/vdsm/gluster/hooks.py index 7f8013e..9619fa2 100644 --- a/vdsm/gluster/hooks.py +++ b/vdsm/gluster/hooks.py @@ -26,7 +26,7 @@ import magic import logging import selinux -import exception as ge +from vdsm.gluster import exception as ge from functools import wraps from . import gluster_mgmt_api from . import safeWrite diff --git a/vdsm/gluster/services.py b/vdsm/gluster/services.py index 782afb6..2352c78 100644 --- a/vdsm/gluster/services.py +++ b/vdsm/gluster/services.py @@ -18,7 +18,7 @@ # Refer to the README and COPYING files for full details of the license # -import exception as ge +from vdsm.gluster import exception as ge from vdsm.tool import service from . import gluster_mgmt_api diff --git a/vdsm/gluster/storagedev.py b/vdsm/gluster/storagedev.py index ca1ee01..32ab65d 100644 --- a/vdsm/gluster/storagedev.py +++ b/vdsm/gluster/storagedev.py @@ -34,7 +34,7 @@ from vdsm import utils import fstab -import exception as ge +from vdsm.gluster import exception as ge from . import gluster_mgmt_api diff --git a/vdsm/gluster/tasks.py b/vdsm/gluster/tasks.py index c531785..a952154 100644 --- a/vdsm/gluster/tasks.py +++ b/vdsm/gluster/tasks.py @@ -19,7 +19,7 @@ # import logging -import exception as ge +from vdsm.gluster import exception as ge from . import gluster_mgmt_api from . import cli from cli import TaskType diff --git a/vdsm/storage/glusterVolume.py b/vdsm/storage/glusterVolume.py index b508097..ed4a40d 100644 --- a/vdsm/storage/glusterVolume.py +++ b/vdsm/storage/glusterVolume.py @@ -23,7 +23,7 @@ from sdc import sdCache import vdsm.supervdsm as svdsm try: - from gluster.exception import GlusterException + from vdsm.gluster.exception import GlusterException _glusterEnabled = True except ImportError: _glusterEnabled = False diff --git a/vdsm/storage/storageServer.py b/vdsm/storage/storageServer.py index 05f69e7..53dcb68 100644 --- a/vdsm/storage/storageServer.py +++ b/vdsm/storage/storageServer.py @@ -45,7 +45,7 @@ import fileSD import iscsi import gluster.cli -import gluster.exception as ge +from vdsm.gluster import exception as ge class AliasAlreadyRegisteredError(RuntimeError): -- To view, visit https://gerrit.ovirt.org/61019 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib97d2728c97d295b83ed452e116e9422184de10f Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Ramesh N <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/admin/lists/[email protected]
