Change in vdsm[master]: Added glusterVolumeProfileStart verb

tjeyasin at redhat.com tjeyasin at redhat.com
Fri Aug 17 10:21:19 UTC 2012


Hello Bala.FA, Saggi Mizrahi, Dan Kenigsberg,

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

    http://gerrit.ovirt.org/7285

to review the following change.

Change subject: Added glusterVolumeProfileStart verb
......................................................................

Added glusterVolumeProfileStart verb

Change-Id: I279977bb4dc3631162ce22668612103896646afe
Signed-off-by: Timothy Asir <tjeyasin at 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, 28 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/7285/1

diff --git a/vdsm/gluster/api.py b/vdsm/gluster/api.py
index 576ddf1..47e5675 100644
--- a/vdsm/gluster/api.py
+++ b/vdsm/gluster/api.py
@@ -221,6 +221,10 @@
         """
         return {'hosts': self.svdsmProxy.glusterPeerStatus()}
 
+    @exportAsVerb
+    def volumeProfileStart(self, volumeName):
+        self.svdsmProxy.glusterVolumeProfileStart(volumeName)
+
 
 def getGlusterMethods(gluster):
     l = []
diff --git a/vdsm/gluster/cli.py b/vdsm/gluster/cli.py
index dd79865..5956bbc 100644
--- a/vdsm/gluster/cli.py
+++ b/vdsm/gluster/cli.py
@@ -543,3 +543,13 @@
     else:
         return _parsePeerStatus(out, _getGlusterHostName(),
                                 _getGlusterUuid(), HostStatus.CONNECTED)
+
+
+ at exportToSuperVdsm
+def volumeProfileStart(volumeName):
+    command = _getGlusterVolCmd() + ["profile", volumeName, "start"]
+    rc, out, err = _execGluster(command)
+    if rc:
+        raise ge.GlusterVolumeProfileStartFailedException(rc, out, err)
+    else:
+        return True
diff --git a/vdsm/gluster/exception.py b/vdsm/gluster/exception.py
index 8d48c48..d2ebc1e 100644
--- a/vdsm/gluster/exception.py
+++ b/vdsm/gluster/exception.py
@@ -347,3 +347,8 @@
 class GlusterHostListFailedException(GlusterHostException):
     code = 4407
     message = "Host list failed"
+
+
+class GlusterVolumeProfileStartFailedException(GlusterVolumeException):
+    code = 4408
+    message = "Volume profile start failed"
diff --git a/vdsm_cli/vdsClientGluster.py b/vdsm_cli/vdsClientGluster.py
index e72c424..1f5d52a 100644
--- a/vdsm_cli/vdsClientGluster.py
+++ b/vdsm_cli/vdsClientGluster.py
@@ -199,6 +199,10 @@
         pp.pprint(status)
         return status['status']['code'], status['status']['message']
 
+    def do_glusterVolumeProfileStart(self, args):
+        status = self.s.glusterVolumeProfileStart(args[0])
+        return status['status']['code'], status['status']['message']
+
 
 def getGlusterCmdDict(serv):
     return {
@@ -355,4 +359,9 @@
              ('',
               'list host info'
               )),
+        'glusterVolumeProfileStart':
+            (serv.do_glusterVolumeProfileStart,
+             ('<volume_name>\n\t<volume_name> is existing volume name',
+              'start gluster volume profile'
+              )),
         }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I279977bb4dc3631162ce22668612103896646afe
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Timothy Asir <tjeyasin at redhat.com>
Gerrit-Reviewer: Bala.FA <barumuga at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>


More information about the vdsm-patches mailing list