From 8d2602b1e5007a186df18b5e7a5179028ad5e88b Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 26 Sep 2012 12:01:29 +0200 Subject: [PATCH] make it a script again --- add_liveboot_request.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/add_liveboot_request.py b/add_liveboot_request.py index a3fad10..9471bb4 100644 --- a/add_liveboot_request.py +++ b/add_liveboot_request.py @@ -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 -- 2.39.5