]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
make it a script again
authorHolger Levsen <holger@layer-acht.org>
Wed, 26 Sep 2012 10:01:29 +0000 (12:01 +0200)
committerHolger Levsen <holger@layer-acht.org>
Wed, 26 Sep 2012 10:01:29 +0000 (12:01 +0200)
add_liveboot_request.py

index a3fad104bf0beac808c8bf05a3f05db4a15073e7..9471bb42996bcc55150706a97d5043bf4c1fdb67 100644 (file)
@@ -87,7 +87,13 @@ 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))
 
-def add_liveboot_request(deb_pkg_instance_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])
+
     logging.basicConfig()
     logger = logging.getLogger()
 
@@ -113,4 +119,3 @@ def add_liveboot_request(deb_pkg_instance_id):
         jenkins_uid = pwd.getpwnam("jenkins").pw_uid
         insert_liveboot_request(con, jenkins_uid, def_pkg_list_id)
         con.commit()
-    return