turn off f24 build
[infrastructure.git] / scripts / check_sfa_peer.py
index 3e22197..e9244c0 100755 (executable)
@@ -14,7 +14,8 @@ ALL = {
 }
 
 import signal,sys
-import sfa.util.xmlrpcprotocol as xmlrpcprotocol
+from sfa.client.sfaserverproxy import SfaServerProxy
+from sfa.client.return_value import ReturnValue
 
 class TimeOutException(Exception):
     pass
@@ -27,7 +28,7 @@ def timeout(signum, frame):
 def get_version(url):
     signal.signal(signal.SIGALRM, timeout)
     signal.alarm(10)
-    server=xmlrpcprotocol.get_server(url, KEY_FILE, CERT_FILE)
+    server=SfaServerProxy(url, KEY_FILE, CERT_FILE)
     try:
         version = server.GetVersion()
     except Exception, why:
@@ -46,7 +47,7 @@ def try_peer(url):
         error += 1
         return
     try:
-        iface = version['interface']
+        iface = ReturnValue.get_value(version)['interface']
     except:
         iface = '(unknown)'
     print "\t[ OK  ] %s (%s)" % (url,iface),
@@ -75,4 +76,5 @@ if __name__ == '__main__':
 
     if (error > 0):
         sys.exit(1)
-
+    else:
+        sys.exit(0)