From: Ciro Scognamiglio Date: Thu, 7 Aug 2014 16:20:39 +0000 (+0200) Subject: services monitor module X-Git-Tag: myslice-1.0~25 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=8fc0e86ef1f2bae962a75732f4f71db26befbfb7 services monitor module --- diff --git a/monitor/__init__.py b/monitor/__init__.py new file mode 100644 index 00000000..206f8c03 --- /dev/null +++ b/monitor/__init__.py @@ -0,0 +1,17 @@ +import os +import threading +from sfa.client.sfaserverproxy import SfaServerProxy +from sfa.client.return_value import ReturnValue + +path=os.path.dirname(os.path.abspath(__file__)) + +SFA_KEY_FILE=os.path.abspath(path + "../myslice/sfa.pkey") +SFA_CERT_FILE=os.path.abspath(path + "../myslice/sfa.cert") + +def get_version(url): + server=SfaServerProxy(url, SFA_KEY_FILE, SFA_CERT_FILE) + try: + version = server.GetVersion() + except Exception, why: + raise + return version \ No newline at end of file diff --git a/portal/templates/onelab/onelab_home-view.html b/portal/templates/onelab/onelab_home-view.html index 5dd577e1..c8ee2d81 100644 --- a/portal/templates/onelab/onelab_home-view.html +++ b/portal/templates/onelab/onelab_home-view.html @@ -182,4 +182,5 @@ This should go into session --------*/ }); -{% endblock %} +{% widget "_widget-monitor.html" %} +{% endblock %} \ No newline at end of file