-import sfa.util.xmlrpcprotocol as xmlrpcprotocol
-import socket
+
+from sfa.storage.alchemy import dbsession
+from sfa.storage.model import RegRecord
+
+from sfa.client.sfaserverproxy import SfaServerProxy
+
+from sfa.generic import Generic
# Get the path to the sfa server key/cert files from
# the sfa hierarchy object
sfa_hierarchy = Hierarchy()
# Get the path to the sfa server key/cert files from
# the sfa hierarchy object
sfa_hierarchy = Hierarchy()
- 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")
+ auth_info = sfa_hierarchy.get_interface_auth_info()
+ key_file = auth_info.get_privkey_filename()
+ cert_file = auth_info.get_gid_filename()
key = Keypair(filename=key_file)
# get a connection to our local sfa registry
# and a valid credential
authority = config.SFA_INTERFACE_HRN
url = 'http://%s:%s/' %(config.SFA_REGISTRY_HOST, config.SFA_REGISTRY_PORT)
key = Keypair(filename=key_file)
# get a connection to our local sfa registry
# and a valid credential
authority = config.SFA_INTERFACE_HRN
url = 'http://%s:%s/' %(config.SFA_REGISTRY_HOST, config.SFA_REGISTRY_PORT)
- registry = xmlrpcprotocol.get_server(url, key_file, cert_file)
- sfa_api = SfaAPI(key_file = key_file, cert_file = cert_file, interface='registry')
+ registry = SfaServerProxy(url, key_file, cert_file)
+ sfa_api = Generic.the_flavour()
found_records.extend([record['hrn'] for record in records])
except ServerException:
# an exception will be thrown if the record doenst exist
found_records.extend([record['hrn'] for record in records])
except ServerException:
# an exception will be thrown if the record doenst exist
- if peer_record['hrn'] not in found_records:
- registries[sfa_api.hrn].remove(credential, peer_record)
+ if peer_record.hrn not in found_records:
+ registries[sfa_api.hrn].Remove(peer_record.hrn, credential, peer_record.type)