X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fserver%2Fsfa_component_setup.py;h=16f358e0a00a0d6d87303c7c13e7efe7489066e3;hb=2b3c0c7ebe7c55afb14e3ea3aed10f8b1abe01e7;hp=072f3b6f6c47e029a966c0ac660bf50a5c6b5567;hpb=4bb7dbe3ccaccb337b57ec1da224556b35a218b9;p=sfa.git diff --git a/sfa/server/sfa_component_setup.py b/sfa/server/sfa_component_setup.py index 072f3b6f..16f358e0 100755 --- a/sfa/server/sfa_component_setup.py +++ b/sfa/server/sfa_component_setup.py @@ -6,7 +6,7 @@ from optparse import OptionParser from sfa.util.faults import ConnectionKeyGIDMismatch from sfa.util.config import Config -import sfa.util.xmlrpcprotocol as xmlrpcprotocol +import sfa.client.xmlrpcprotocol as xmlrpcprotocol from sfa.util.plxrn import hrn_to_pl_slicename, slicename_to_hrn from sfa.trust.certificate import Keypair, Certificate @@ -28,7 +28,7 @@ def handle_gid_mismatch_exception(f): return wrapper -def get_server(url=None, port=None, keyfile=None, certfile=None,verbose=False): +def server_proxy(url=None, port=None, keyfile=None, certfile=None,verbose=False): """ returns an xmlrpc connection to the service a the specified address @@ -48,7 +48,7 @@ def get_server(url=None, port=None, keyfile=None, certfile=None,verbose=False): if verbose: print "Contacting registry at: %(url)s" % locals() - server = xmlrpcprotocol.get_server(url, keyfile, certfile) + server = xmlrpcprotocol.server_proxy(url, keyfile, certfile) return server @@ -97,7 +97,7 @@ def get_node_key(registry=None, verbose=False): cert.sign() cert.save_to_file(certfile) - registry = get_server(url = registry, keyfile=keyfile, certfile=certfile) + registry = server_proxy(url = registry, keyfile=keyfile, certfile=certfile) registry.get_key() def create_server_keypair(keyfile=None, certfile=None, hrn="component", verbose=False): @@ -145,7 +145,7 @@ def get_credential(registry=None, force=False, verbose=False): create_server_keypair(keyfile, certfile, hrn, verbose) # get credential from registry - registry = get_server(url=registry, keyfile=keyfile, certfile=certfile) + registry = server_proxy(url=registry, keyfile=keyfile, certfile=certfile) cert = Certificate(filename=certfile) cert_str = cert.save_to_string(save_parents=True) cred = registry.GetSelfCredential(cert_str, 'node', hrn) @@ -172,7 +172,7 @@ def get_trusted_certs(registry=None, verbose=False): cred = get_credential(registry=registry, verbose=verbose) # make sure server key cert pair exists create_server_keypair(keyfile=keyfile, certfile=certfile, hrn=hrn, verbose=verbose) - registry = get_server(url=registry, keyfile=keyfile, certfile=certfile) + registry = server_proxy(url=registry, keyfile=keyfile, certfile=certfile) # get the trusted certs and save them in the right place if verbose: print "Getting trusted certs from registry" @@ -217,12 +217,11 @@ def get_gids(registry=None, verbose=False): cred = get_credential(registry=registry, verbose=verbose) # make sure server key cert pair exists create_server_keypair(keyfile=keyfile, certfile=certfile, hrn=hrn, verbose=verbose) - registry = get_server(url=registry, keyfile=keyfile, certfile=certfile) + registry = server_proxy(url=registry, keyfile=keyfile, certfile=certfile) if verbose: print "Getting current slices on this node" # get a list of slices on this node - # make sure you run with SFA_GENERIC_FLAVOUR=plcm from sfa.generic import Generic generic=Generic.the_flavour() api = generic.make_api(interface='component')