From 93848522905614dd36c4acb8b851fccb3536d7ce Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Fri, 23 Oct 2009 14:54:53 +0000 Subject: [PATCH] pass request_hash argument to interface calls --- sfa/server/sfa-clean-peer-records.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sfa/server/sfa-clean-peer-records.py b/sfa/server/sfa-clean-peer-records.py index 05cf65c9..111743a5 100644 --- a/sfa/server/sfa-clean-peer-records.py +++ b/sfa/server/sfa-clean-peer-records.py @@ -8,6 +8,7 @@ from sfa.util.genitable import GeniTable from sfa.util.geniclient import GeniClient from sfa.plc.api import GeniAPI from sfa.util.config import Config +from sfa.trust.certificate import Keypair from sfa.trust.hierarchy import Hierarchy from sfa.util.report import trace, error from sfa.server.registry import Registries @@ -25,6 +26,7 @@ def main(): sfa_key_path = sfa_hierarchy.basedir key_file = os.path.join(sfa_key_path, "server.key") cert_file = os.path.join(sfa_key_path, "server.cert") + key = Keypair(filename=key_file) # get a connection to our local sfa registry # and a valid credential @@ -45,11 +47,16 @@ def main(): peer_auth = peer_record['peer_authority'] if peer_auth in registries: try: - records = registries[peer_auth].resolve(credential, peer_record['hrn']) + peer_record_hrn = peer_record['hrn'] + arg_list = [credential, peer_record_hrn] + request_hash = key.compute_hash(arg_list) + records = registries[peer_auth].resolve(credential, peer_record_hrn, request_hash) 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) + arg_list = [credential] + request_hash = key.compute_hash(arg_list) + registries[sfa_api.hrn].remove_peer_object(credential, peer_record, request_hash) except: traceback.print_exc() if __name__ == '__main__': -- 2.47.0