From c6f8288bc13c54c464504e041eb3609781e7dbde Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 15 Nov 2013 14:44:30 +0100 Subject: [PATCH] build drivers from an api instance, not a config anymore --- sfa/iotlab/iotlabdriver.py | 9 +++++---- sfa/iotlab/iotlabshell.py | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sfa/iotlab/iotlabdriver.py b/sfa/iotlab/iotlabdriver.py index a5703d4b..910804e2 100644 --- a/sfa/iotlab/iotlabdriver.py +++ b/sfa/iotlab/iotlabdriver.py @@ -28,7 +28,7 @@ class IotlabDriver(Driver): .. seealso::: Driver class """ - def __init__(self, config): + def __init__(self, api): """ Sets the iotlab SFA config parameters, @@ -38,9 +38,10 @@ class IotlabDriver(Driver): :type config: Config object """ - Driver.__init__(self, config) - self.config = config - self.testbed_shell = IotlabShell(config) + Driver.__init__(self, api) + self.api=api + config = api.config + self.testbed_shell = IotlabShell(api) self.cache = None def augment_records_with_testbed_info(self, record_list): diff --git a/sfa/iotlab/iotlabshell.py b/sfa/iotlab/iotlabshell.py index f1efa73f..081eb4ee 100644 --- a/sfa/iotlab/iotlabshell.py +++ b/sfa/iotlab/iotlabshell.py @@ -28,7 +28,7 @@ class IotlabShell(): _MINIMUM_DURATION = 10 # 10 units of granularity 60 s, 10 mins - def __init__(self, config): + def __init__(self, api): """Creates an instance of OARrestapi and LDAPapi which will be used to issue calls to OAR or LDAP methods. Set the time format and the testbed granularity used for OAR @@ -37,6 +37,8 @@ class IotlabShell(): :param config: configuration object from sfa.util.config :type config: Config object """ + self.api=api + config=api.config self.leases_db = TestbedAdditionalSfaDB(config) self.oar = OARrestapi() self.ldap = LDAPapi() -- 2.43.0