Implement locking and unlocking submissions
authorEd Bartosh <eduard.bartosh@intel.com>
Sun, 11 Jan 2015 00:30:29 +0000 (02:30 +0200)
committerZhuoX Li <zhuox.li@intel.com>
Wed, 14 Jan 2015 06:26:56 +0000 (14:26 +0800)
Implemented by disabling/enabling build globaly
for prerelease project.

Fixes: #2298

Change-Id: Ib7f072cd919b6495bb4a364fd9048031a7c8dddf
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
job_re.py

index d871589..7b9126e 100755 (executable)
--- a/job_re.py
+++ b/job_re.py
@@ -119,6 +119,11 @@ def main():
             prj = get_project_by_name(build, submission, target_project)[0]
             build.delete_project(prj, force=True, msg=comment)
             print "Submission %s has been removed" % submission
+        elif action in ("lock", "unlock"):
+            prj = get_project_by_name(build, submission, target_project)[0]
+            status = "disable" if action == "lock" else "enable"
+            build.set_global_flag("build", status, prj)
+            print "Submission %s has been %sed" % (submission, action)
         else:
             raise LocalError("Unsupported action: '%s'" % action)
     elif not submission: