From: Thierry Parmentelat Date: Wed, 6 Apr 2011 15:53:46 +0000 (+0200) Subject: honor SFA_AGGREGATE_ENABLED X-Git-Tag: sfa-1.0-21-ckp1~74^2~24 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=07f6cd9b68e5cab4e4e01a3132dc493a39907db9;p=sfa.git honor SFA_AGGREGATE_ENABLED --- diff --git a/sfa/server/aggregate.py b/sfa/server/aggregate.py index dc1a61cf..1a96e157 100644 --- a/sfa/server/aggregate.py +++ b/sfa/server/aggregate.py @@ -25,16 +25,16 @@ class Aggregates(Interfaces): def __init__(self, api, conf_file = "/etc/sfa/aggregates.xml"): Interfaces.__init__(self, api, conf_file) # set up a connection to the local aggregate - # xxx fixme ? - should not we do this only when SFA_AGGREGATE_ENABLED ? - address = self.api.config.SFA_AGGREGATE_HOST - port = self.api.config.SFA_AGGREGATE_PORT - url = 'http://%(address)s:%(port)s' % locals() - local_aggregate = {'hrn': self.api.hrn, - 'urn': hrn_to_urn(self.api.hrn, 'authority'), - 'addr': address, - 'port': port, - 'url': url} - self.interfaces[self.api.hrn] = local_aggregate + if self.api.config.SFA_AGGREGATE_ENABLED: + address = self.api.config.SFA_AGGREGATE_HOST + port = self.api.config.SFA_AGGREGATE_PORT + url = 'http://%(address)s:%(port)s' % locals() + local_aggregate = {'hrn': self.api.hrn, + 'urn': hrn_to_urn(self.api.hrn, 'authority'), + 'addr': address, + 'port': port, + 'url': url} + self.interfaces[self.api.hrn] = local_aggregate # get connections self.update(self.get_connections())