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
11 Creates the iotlab specific lease table to keep track
12 of which slice hrn match OAR job
15 def __init__(self, auth_hierarchy, loc_logger):
16 self.logger = loc_logger
17 self.logger.setLevelDebug()
19 def _exists(self, tablename):
21 Checks if the table exists in SFA database.
23 metadata = MetaData(bind=engine)
25 Table(tablename, metadata, autoload=True)
28 except NoSuchTableError:
32 def run(self, options):
34 if not self._exists('lease_table'):
36 self.logger.info("iotlabimporter run lease_table created")