Change in vdsm[master]: Adding call to svdsm.ping from vdsm ping verb

ybronhei at redhat.com ybronhei at redhat.com
Tue Aug 20 13:02:34 UTC 2013


Yaniv Bronhaim has uploaded a new change for review.

Change subject: Adding call to svdsm.ping from vdsm ping verb
......................................................................

Adding call to svdsm.ping from vdsm ping verb

In additional to adding supervdsm ping call, this also allows calling to ping
verb from vdsClient

Change-Id: Ifc4caf642ce6d8281fa97f7f26ec39575304f339
Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
---
M client/vdsClient.py
M vdsm/API.py
2 files changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/18329/1

diff --git a/client/vdsClient.py b/client/vdsClient.py
index c52256a..38a09e8 100644
--- a/client/vdsClient.py
+++ b/client/vdsClient.py
@@ -1744,6 +1744,10 @@
 
         return status['status']['code'], status['status']['message']
 
+    def do_ping(self, args):
+        return self.ExecAndExit(self.s.ping())
+
+
 if __name__ == '__main__':
     if _glusterEnabled:
         serv = ge.GlusterService()
@@ -2489,6 +2493,11 @@
                 '<vmId> <spUUID> <sdUUID> <imgUUID> <volUUID> <newSize>',
                 'Extends the virtual size of a disk'
             )),
+        'ping': (
+            serv.do_ping, (
+                '',
+                'Check connectivity with vdsm and supervdsm'
+            )),
     }
     if _glusterEnabled:
         commands.update(ge.getGlusterCmdDict(serv))
diff --git a/vdsm/API.py b/vdsm/API.py
index 37bb908..58d6815 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -1152,6 +1152,12 @@
 
     def ping(self):
         "Ping the server. Useful for tests"
+        try:
+            supervdsm.getProxy().ping()
+        except:
+            return {'status':
+                    {'code': 1, 'message': "Couldn't ping supervdsm"}}
+
         return {'status': doneCode}
 
     def getCapabilities(self):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifc4caf642ce6d8281fa97f7f26ec39575304f339
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>


More information about the vdsm-patches mailing list