Change in vdsm[ovirt-3.3]: Keeping gluster modules when with_gluster set to 0

ybronhei at redhat.com ybronhei at redhat.com
Sun Nov 24 12:10:47 UTC 2013


Hello Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/21577

to review the following change.

Change subject: Keeping gluster modules when with_gluster set to 0
......................................................................

Keeping gluster modules when with_gluster set to 0

Currently the code imports and uses gluster modules. Setting
with_gluster=0 brakes the code. With this patch with_gluster=0 will
only drop the vdsm-gluster rpm creation.

Change-Id: I1cdbd8b399652bf0d306308e2d4cfc0014be689c
Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/21477
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm.spec.in
M vdsm/supervdsmServer
2 files changed, 10 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/77/21577/1

diff --git a/vdsm.spec.in b/vdsm.spec.in
index 5e306e4..91d3168 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -895,12 +895,8 @@
 %{_datadir}/%{vdsm_name}/storage/fileUtils.py*
 %{_datadir}/%{vdsm_name}/storage/fileVolume.py*
 %{_datadir}/%{vdsm_name}/storage/fuser.py*
-%if 0%{?with_gluster}
 %{_datadir}/%{vdsm_name}/storage/glusterSD.py*
 %{_datadir}/%{vdsm_name}/storage/glusterVolume.py*
-%else
-%exclude %{_datadir}/%{vdsm_name}/storage/gluster*
-%endif
 %{_datadir}/%{vdsm_name}/storage/hba.py*
 %{_datadir}/%{vdsm_name}/storage/hsm.py*
 %{_datadir}/%{vdsm_name}/storage/image.py*
@@ -1086,11 +1082,11 @@
 %{_datadir}/%{vdsm_name}/tests/netmaskconversions
 %{_datadir}/%{vdsm_name}/tests/run_tests.sh
 %{_datadir}/%{vdsm_name}/tests/tc_filter_show.out
-%if 0%{?with_gluster}
 %{_datadir}/%{vdsm_name}/tests/glusterVolumeProfileInfo.xml
 %{_datadir}/%{vdsm_name}/tests/glusterVolumeProfileInfoNfs.xml
 %{_datadir}/%{vdsm_name}/tests/glusterVolumeRebalanceStatus.xml
 %{_datadir}/%{vdsm_name}/tests/glusterVolumeRemoveBricksStatus.xml
+%{_datadir}/%{vdsm_name}/tests/glusterVolumeTasks.xml
 %else
 %exclude %{_datadir}/%{vdsm_name}/tests/gluster*
 %endif
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index 40ec9df..7fa1c2b 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -43,7 +43,12 @@
 
 from storage import fuser
 from multiprocessing import Pipe, Process
-from gluster import listPublicFunctions
+try:
+    from gluster import listPublicFunctions
+    _glusterEnabled = True
+except ImportError:
+    _glusterEnabled = False
+
 import storage.misc as misc
 from vdsm import utils
 from parted_utils import getDevicePartedInfo as _getDevicePartedInfo
@@ -362,8 +367,9 @@
             return func(*args, **kwargs)
         return wrapper
 
-    for name, func in listPublicFunctions():
-        setattr(_SuperVdsm, name, logDecorator(bind(func)))
+    if _glusterEnabled:
+        for name, func in listPublicFunctions():
+            setattr(_SuperVdsm, name, logDecorator(bind(func)))
 
     try:
         log.debug("Making sure I'm root - SuperVdsm")


-- 
To view, visit http://gerrit.ovirt.org/21577
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1cdbd8b399652bf0d306308e2d4cfc0014be689c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list