Base = declarative_base()
engine = create_engine('sqlite:///%s' %(PERSISTENCE_FILE))
Session = sessionmaker(bind=engine)
-Base.metadata.create_all(engine)
# FIXME: move this into own logger Class
logger = logging.getLogger(sys.argv[0])
self.identifier, self.last_version, self.branch_name, self.pb_modules
)
+Base.metadata.create_all(engine)
+
def get_last_kernel_revision_obj(branch):
session = Session()
logger.debug('Getting kernel revision from persistence')
try:
answ = session.query(KernelVersion).filter(
KernelVersion.identifier == persistence_identifier).one()
- except:
+ except NoResultFound:
session.add(KernelVersion(persistence_identifier, 0, branch, ''))
session.commit()
answ = session.query(KernelVersion).filter(