Change in vdsm[master]: gluster: raise proper execption if mount point already used

tjeyasin at redhat.com tjeyasin at redhat.com
Wed May 13 19:05:06 UTC 2015


Timothy Asir has uploaded a new change for review.

Change subject: gluster: raise proper execption if mount point already used
......................................................................

gluster: raise proper execption if mount point already used

Currently if an already used mount point is given for the brick
create function, it does all the lvm tasks and returns Unexpected
Exception when it tries to mout the device at the end of brick
create scenario. This patch will check given mount point availablity
and returns an appropriate exception.

Change-Id: Ic12acd2e4bf6a88936af582bb17d50d72cdfb84f
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1209475
Signed-off-by: Timothy Asir Jeyasingh <tjeyasin at redhat.com>
---
M vdsm/gluster/exception.py
M vdsm/gluster/storagedev.py
2 files changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/92/40892/1

diff --git a/vdsm/gluster/exception.py b/vdsm/gluster/exception.py
index d093661..cd5babe 100644
--- a/vdsm/gluster/exception.py
+++ b/vdsm/gluster/exception.py
@@ -467,6 +467,16 @@
     message = "Make directories failed"
 
 
+class GlusterHostStorageMountPointAlreadyFoundException(GlusterHostException):
+    code = 4517
+
+    def __init__(self, mountPoint, rc=0, out=(), err=()):
+        self.rc = rc
+        self.out = out
+        self.err = err
+        self.message = "Mount point %s already found" % mountPoint)
+
+
 # Hook
 class GlusterHookException(GlusterException):
     code = 4500
diff --git a/vdsm/gluster/storagedev.py b/vdsm/gluster/storagedev.py
index a860179..0968e6b 100644
--- a/vdsm/gluster/storagedev.py
+++ b/vdsm/gluster/storagedev.py
@@ -32,6 +32,7 @@
 from blivet.devices import LVMThinLogicalVolumeDevice
 
 import storage.lvm as lvm
+import storage.mount as mount
 from vdsm import utils
 
 import fstab
@@ -214,6 +215,10 @@
             blivetEnv.reset()
             return blivetEnv.devicetree.getDeviceByName(poolLv.name)
 
+    if mount.isMounted(mountPoint):
+        raise ge.GlusterHostStorageMountPointAlreadyFoundException(
+            mountPoint, rc, out, err)
+
     vgName = "vg-" + brickName
     poolName = "pool-" + brickName
     alignment = 0


-- 
To view, visit https://gerrit.ovirt.org/40892
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic12acd2e4bf6a88936af582bb17d50d72cdfb84f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <tjeyasin at redhat.com>


More information about the vdsm-patches mailing list