Changing name of create_engine in iotlabpostgres to create_iotlab_engine.
Adding forgotten import in importer.
from sfa.util.xrn import Xrn, get_authority, hrn_to_urn
from sfa.iotlab.iotlabdriver import IotlabDriver
-
+from sfa.iotlab.iotlabpostgres import IotlabDB, Iotlab_xp
from sfa.trust.certificate import Keypair, convert_public_key
from sfa.trust.gid import create_uuid
config = Config()
iotlabdriver = IotlabDriver(config)
-
+ iotlab_db = IotlabDB(config)
#Create special slice table for iotlab
- if not iotlabdriver.db.exists('iotlab_xp'):
- iotlabdriver.db.createtable()
+ if not iotlab_db.exists('iotlab_xp'):
+ iotlab_db.createtable()
self.logger.info ("IotlabImporter.run: iotlab_xp table created ")
self.ldap = LDAPapi()
self.time_format = "%Y-%m-%d %H:%M:%S"
self.root_auth = config.SFA_REGISTRY_ROOT_AUTH
- self.grain = 1 # 10 mins lease minimum
+ self.grain = 1 # 10 mins lease minimum, 1 sec granularity
#import logging, logging.handlers
#from sfa.util.sfalogging import _SfaLogger
#sql_logger = _SfaLogger(loggername = 'sqlalchemy.engine', \
Driver.__init__ (self, config)
self.config = config
- self.db = IotlabDB(config, debug = False)
+ # self.db = IotlabDB(config, debug = False)
self.iotlab_api = IotlabTestbedAPI(config)
self.cache = None
class Singleton:
"""
Class used with this Python singleton design pattern
- @todo Add all variables, and methods needed for the
- Singleton class below
"""
def __init__(self, config, debug = False):
self.iotlab_engine = None
self.iotlab_session = None
- self.create_engine(config, debug)
+ self.create_iotlab_engine(config, debug)
self.session()
- def create_engine(self, config, debug = False):
+ def create_iotlab_engine(self, config, debug = False):
if debug == True:
self.iotlab_session.close()
self.iotlab_session = None
+
def update_jobs_in_iotlabdb(self, job_oar_list, jobs_psql):
""" Cleans the iotlab db by deleting expired and cancelled jobs.
Compares the list of job ids given by OAR with the job ids that