- def __init__(self, api, conf_file = "/etc/sfa/registries.xml"):
- Interfaces.__init__(self, api, conf_file, 'sa')
-
- def get_connections(self, interfaces):
- """
- read connection details for the trusted peer registries from file return
- a dictionary of connections keyed on interface hrn.
- """
- connections = Interfaces.get_connections(self, interfaces)
-
- # set up a connection to the local registry
- 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, 'addr': address, 'port': port}
- connections[self.api.hrn] = xmlrpcprotocol.get_server(url, self.api.key_file, self.api.cert_file)
- return 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