Hello Bala.FA, Saggi Mizrahi, Dan Kenigsberg,

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

    http://gerrit.ovirt.org/7435

to review the following change.

Change subject: Added glusterVolumeProfileStop verb
......................................................................

Added glusterVolumeProfileStop verb

Change-Id: Ie25c7da7208eb4bf68f67d945fb7c63b44886040
Signed-off-by: Timothy Asir <tjeya...@redhat.com>
---
M vdsm/gluster/api.py
M vdsm/gluster/cli.py
M vdsm/gluster/exception.py
M vdsm_cli/vdsClientGluster.py
4 files changed, 27 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/7435/1

diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py
index 135f4bb..dc3ec0b 100644
--- a/vdsm/gluster/api.py
+++ b/vdsm/gluster/api.py
@@ -225,6 +225,10 @@
     def volumeProfileStart(self, volumeName, options=None):
         self.svdsmProxy.glusterVolumeProfileStart(volumeName)
 
+    @exportAsVerb
+    def volumeProfileStop(self, volumeName, options=None):
+        self.svdsmProxy.glusterVolumeProfileStop(volumeName)
+
 
 def getGlusterMethods(gluster):
     l = []
diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py
index 9d05568..2618aa1 100644
--- a/vdsm/gluster/cli.py
+++ b/vdsm/gluster/cli.py
@@ -568,3 +568,12 @@
     if err:
         raise ge.GlusterVolumeProfileStartFailedException(err[0], err[1])
     return True
+
+
+@exportToSuperVdsm
+def volumeProfileStop(volumeName):
+    command = _getGlusterVolCmd() + ["profile", volumeName, "stop"]
+    err, res = _execGluster(command, xml=True)
+    if err:
+        raise ge.GlusterVolumeProfileStopFailedException(err[0], err[1])
+    return True
diff --git a/vdsm/gluster/exception.py b/vdsm/gluster/exception.py
index 29078a9..f5dfb73 100644
--- a/vdsm/gluster/exception.py
+++ b/vdsm/gluster/exception.py
@@ -323,6 +323,11 @@
     message = "Volume profile start failed"
 
 
+class GlusterVolumeProfileStopFailedException(GlusterVolumeException):
+    code = 4158
+    message = "Volume profile stop failed"
+
+
 # Host
 class GlusterHostException(GlusterException):
     code = 4400
diff --git a/vdsm_cli/vdsClientGluster.py b/vdsm_cli/vdsClientGluster.py
index 1f5d52a..0a253fe 100644
--- a/vdsm_cli/vdsClientGluster.py
+++ b/vdsm_cli/vdsClientGluster.py
@@ -203,6 +203,10 @@
         status = self.s.glusterVolumeProfileStart(args[0])
         return status['status']['code'], status['status']['message']
 
+    def do_glusterVolumeProfileStop(self, args):
+        status = self.s.glusterVolumeProfileStop(args[0])
+        return status['status']['code'], status['status']['message']
+
 
 def getGlusterCmdDict(serv):
     return {
@@ -364,4 +368,9 @@
              ('<volume_name>\n\t<volume_name> is existing volume name',
               'start gluster volume profile'
               )),
+        'glusterVolumeProfileStop':
+            (serv.do_glusterVolumeProfileStop,
+             ('<volume_name>\n\t<volume_name> is existing volume name',
+              'stop gluster volume profile'
+              )),
         }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie25c7da7208eb4bf68f67d945fb7c63b44886040
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <tjeya...@redhat.com>
Gerrit-Reviewer: Bala.FA <barum...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizr...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to