X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fserver%2Fregistry.py;h=b55f9acdb532f454a6564c544e5ed4aefd74b0f7;hb=00018e8f437f02c99e438f17c57aafc038052171;hp=1dea183b42ef3d4986d05ede040dcb302e3fedd1;hpb=cb83b38f6586314d51e23dad227047d126bd4b76;p=sfa.git diff --git a/sfa/server/registry.py b/sfa/server/registry.py index 1dea183b..b55f9acd 100644 --- a/sfa/server/registry.py +++ b/sfa/server/registry.py @@ -1,17 +1,11 @@ # # Registry is a SfaServer that implements the Registry interface # -### $Id$ -### $URL$ -# - -from sfa.util.server import SfaServer +from sfa.server.sfaserver import SfaServer from sfa.util.faults import * -from sfa.util.namespace import hrn_to_urn -from sfa.server.interface import Interfaces -import sfa.util.xmlrpcprotocol as xmlrpcprotocol -import sfa.util.soapprotocol as soapprotocol - +from sfa.util.xrn import hrn_to_urn +from sfa.server.interface import Interfaces, Interface +from sfa.util.config import Config ## # Registry is a SfaServer that serves registry and slice operations at PLC. @@ -35,17 +29,12 @@ class Registries(Interfaces): default_dict = {'registries': {'registry': [Interfaces.default_fields]}} - def __init__(self, api, conf_file = "/etc/sfa/registries.xml"): - Interfaces.__init__(self, api, conf_file) - address = self.api.config.SFA_REGISTRY_HOST - port = self.api.config.SFA_REGISTRY_PORT - url = 'http://%(address)s:%(port)s' % locals() - local_registry = {'hrn': self.api.hrn, - 'urn': hrn_to_urn(self.api.hrn, 'authority'), - 'addr': address, - 'port': port, - 'url': url} - self.interfaces[self.api.hrn] = local_registry - - # get connections - self.update(self.get_connections()) + def __init__(self, conf_file = "/etc/sfa/registries.xml"): + Interfaces.__init__(self, conf_file) + sfa_config = Config() + if sfa_config.SFA_REGISTRY_ENABLED: + addr = sfa_config.SFA_REGISTRY_HOST + port = sfa_config.SFA_REGISTRY_PORT + hrn = sfa_config.SFA_INTERFACE_HRN + interface = Interface(hrn, addr, port) + self[hrn] = interface