git://git.onelab.eu
/
infrastructure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
no need to call this build r2lab
[infrastructure.git]
/
scripts
/
check_sfa_peer.py
diff --git
a/scripts/check_sfa_peer.py
b/scripts/check_sfa_peer.py
index
3e22197
..
e9244c0
100755
(executable)
--- a/
scripts/check_sfa_peer.py
+++ b/
scripts/check_sfa_peer.py
@@
-14,7
+14,8
@@
ALL = {
}
import signal,sys
}
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
class TimeOutException(Exception):
pass
@@
-27,7
+28,7
@@
def timeout(signum, frame):
def get_version(url):
signal.signal(signal.SIGALRM, timeout)
signal.alarm(10)
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:
try:
version = server.GetVersion()
except Exception, why:
@@
-46,7
+47,7
@@
def try_peer(url):
error += 1
return
try:
error += 1
return
try:
- iface =
version
['interface']
+ iface =
ReturnValue.get_value(version)
['interface']
except:
iface = '(unknown)'
print "\t[ OK ] %s (%s)" % (url,iface),
except:
iface = '(unknown)'
print "\t[ OK ] %s (%s)" % (url,iface),
@@
-75,4
+76,5
@@
if __name__ == '__main__':
if (error > 0):
sys.exit(1)
if (error > 0):
sys.exit(1)
-
+ else:
+ sys.exit(0)