From: Sapan Bhatia Date: Mon, 21 Sep 2009 20:34:48 +0000 (+0000) Subject: Trivial change to add support for non-PLC aggregates X-Git-Tag: sfa-0.9-3~61 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=628ecbc8e542b6cefed780b7373d90aba3662985 Trivial change to add support for non-PLC aggregates --- diff --git a/sfa/plc/api.py b/sfa/plc/api.py index cf311e2f..a1e702fe 100644 --- a/sfa/plc/api.py +++ b/sfa/plc/api.py @@ -117,8 +117,12 @@ class GeniAPI: self.key_file = key_file self.cert_file = cert_file self.credential = None - self.plshell = self.getPLCShell() - self.plshell_version = self.getPLCShellVersion() + + # Initialize the PLC shell only if SFA wraps a myPLC + if (self.config.get_aggregate_rspec_type() == 'pl'): + self.plshell = self.getPLCShell() + self.plshell_version = self.getPLCShellVersion() + self.hrn = self.config.SFA_INTERFACE_HRN self.time_format = "%Y-%m-%d %H:%M:%S" self.logger=get_sfa_logger() diff --git a/sfa/util/config.py b/sfa/util/config.py index 1c0b9c96..919c3482 100644 --- a/sfa/util/config.py +++ b/sfa/util/config.py @@ -41,15 +41,6 @@ class Config: except IOError, e: raise IOError, "Could not find the configuration file: %s" % config_file - ## - # - # Very hacky - to change after July 21. - # - # The generation/parsing of RSpecs is based on the value returned by this function. vini and max - # use some new code, while pl uses old code. As long as you don't set SFA_AGGREGATE_RSPEC_TYPE in your - # config file, the new code will not apply to your deployment. - # - def get_aggregate_rspec_type(self): if (hasattr(self,'SFA_AGGREGATE_RSPEC_TYPE')): return self.SFA_AGGREGATE_RSPEC_TYPE