}
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
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:
error += 1
return
try:
- iface = version['interface']
+ iface = ReturnValue.get_value(version)['interface']
except:
iface = '(unknown)'
print "\t[ OK ] %s (%s)" % (url,iface),
if (error > 0):
sys.exit(1)
-
+ else:
+ sys.exit(0)