2 """ Iot-LAB importer class management """
4 from sfa.storage.alchemy import engine
5 from sfa.storage.model import init_tables
6 from sqlalchemy import Table, MetaData
7 from sqlalchemy.exc import NoSuchTableError
12 Creates the iotlab specific lease table to keep track
13 of which slice hrn match OAR job
16 def __init__(self, auth_hierarchy, loc_logger):
17 self.logger = loc_logger
18 self.logger.setLevelDebug()
20 def add_options(self, parser):
21 """ Not used and need by SFA """
24 def _exists(self, tablename):
26 Checks if the table exists in SFA database.
28 metadata = MetaData(bind=engine)
30 Table(tablename, metadata, autoload=True)
33 except NoSuchTableError:
36 def run(self, options):
38 if not self._exists('lease_table'):
40 self.logger.info("iotlabimporter run lease_table created")