]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
fix
authorHolger Levsen <holger@layer-acht.org>
Wed, 2 Nov 2011 10:48:16 +0000 (11:48 +0100)
committerHolger Levsen <holger@layer-acht.org>
Wed, 2 Nov 2011 10:48:16 +0000 (11:48 +0100)
kernel_build.py
kernel_persistance.py

index 5a7828f18387d2024f52b58f3b9a4c8f36ec446a..7ae390308a5261dd5d5bfe3223105c81746d81f0 100644 (file)
@@ -137,9 +137,9 @@ def exit_error():
 if __name__ == '__main__':
     logger.debug('running with this enviroment: %s', os.environ)
     atexit.register(remove_git_target_workspace)
-    kernel_revision_obj = get_last_kernel_revision_obj()
+    kernel_revision_obj = kernel_persistence.get_last_kernel_revision_obj()
     new_version = kernel_revision_obj.last_version + 1
-    if not update_kernel_revision_obj(kernel_revision_obj, new_version):
+    if not kernel_persistance.update_kernel_revision_obj(kernel_revision_obj, new_version):
         logger.info(
                 'Could not update persistence version to %s for %s'
                 %(new_version, GIT_BRANCH_NAME)
index 58ae79615517f82c8292b862104fc78bf4883595..e0d9c9a29f87bae93cc3a9852d9a4af980252f62 100644 (file)
@@ -12,9 +12,9 @@ CWD = os.environ.get('WORKSPACE')
 PERSISTENCE_FILE = os.path.join(CWD, '..', '.persistence')
 
 Base = declarative_base()
-
 engine = create_engine('sqlite:///%s' %(PERSISTENCE_FILE))
 Session = sessionmaker(bind=engine)
+Base.metadata.create_all(engine)
 
 class KernelVersion(Base):
     __tablename__ = 'branch_kernel_version'
@@ -35,8 +35,6 @@ class KernelVersion(Base):
                 self.identifier, self.last_version
         )
 
-Base.metadata.create_all(engine)
-
 def get_last_kernel_revision_obj():
     session = Session()
     logger.debug('Getting kernel revision from persistence')
@@ -79,5 +77,3 @@ def update_kernel_revision_obj(kernel_version_obj, new_revision):
         return True
     finally:
         session.close()
-
-