]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
Revert "make it a script again"
authorHolger Levsen <holger@layer-acht.org>
Wed, 26 Sep 2012 10:04:09 +0000 (12:04 +0200)
committerHolger Levsen <holger@layer-acht.org>
Wed, 26 Sep 2012 10:04:09 +0000 (12:04 +0200)
This reverts commit 8d2602b1e5007a186df18b5e7a5179028ad5e88b.

add_liveboot_request.py

index 9471bb42996bcc55150706a97d5043bf4c1fdb67..a3fad104bf0beac808c8bf05a3f05db4a15073e7 100644 (file)
@@ -87,13 +87,7 @@ def insert_liveboot_request(con, owner_uid, package_list_id):
     cur.execute("INSERT INTO liveboot_request(owner_uid, package_list_id)"
         " VALUES(%s)", (owner_uid, package_list_id))
 
-if __name__ == "__main__":
-    if len(sys.argv) != 2:
-        print("usage: %s deb_package_instance_id")
-        sys.exit(1)
-
-    deb_pkg_instance_id = int(sys.argv[1])
-
+def add_liveboot_request(deb_pkg_instance_id):
     logging.basicConfig()
     logger = logging.getLogger()
 
@@ -119,3 +113,4 @@ if __name__ == "__main__":
         jenkins_uid = pwd.getpwnam("jenkins").pw_uid
         insert_liveboot_request(con, jenkins_uid, def_pkg_list_id)
         con.commit()
+    return