From: Anil-Kumar Vengalil Date: Sat, 3 Oct 2009 19:09:04 +0000 (+0000) Subject: not to remove a peer_object from the local registry when the sfa service on the remot... X-Git-Tag: sfa-0.9-3~5 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=712c7e66e7853ee367c15123f387c9dd2e14e220 not to remove a peer_object from the local registry when the sfa service on the remote peer is down --- diff --git a/sfa/server/sfa-clean-peer-records.py b/sfa/server/sfa-clean-peer-records.py index 635b1149..fbf3b684 100644 --- a/sfa/server/sfa-clean-peer-records.py +++ b/sfa/server/sfa-clean-peer-records.py @@ -10,6 +10,8 @@ from sfa.util.config import Config from sfa.trust.hierarchy import Hierarchy from sfa.util.report import trace, error from sfa.server.registry import Registries +from sfa.util.xmlrpcprotocol import ServerException +import socket def main(): config = Config() @@ -43,10 +45,11 @@ def main(): if peer_auth in registries: try: records = registries[peer_auth].resolve(credential, peer_record['hrn']) - except: + except ServerException: # an exception will be thrown if the record doenst exist # if so remove the record from the local registry registries[sfa_api.hrn].remove_peer_object(credential, peer_record) - + except: + pass if __name__ == '__main__': main()