Add placehoders for new actions
authorEd Bartosh <eduard.bartosh@intel.com>
Sat, 10 Jan 2015 19:58:55 +0000 (21:58 +0200)
committerZhuoX Li <zhuox.li@intel.com>
Wed, 14 Jan 2015 06:25:56 +0000 (14:25 +0800)
Printed 'Not implemented' messages for 'rebuild' and 'remove' actions.
Raised exception for unsupported actions.

Change-Id: I1c5955030aa0fa9f8943dab33a41e9b6c3ee6fca

job_re.py

index 5b34e59..456f86e 100755 (executable)
--- a/job_re.py
+++ b/job_re.py
@@ -99,9 +99,16 @@ def main():
     submission = os.getenv("submission")
     comment = os.getenv("comment")
     if submission and comment:
-        state = "accepted" if action == "accept" else "declined"
-        return accept_or_reject(build, submission, state,
-                                target_project, comment)
+        if action in ("accept", "reject"):
+            state = "accepted" if action == "accept" else "declined"
+            return accept_or_reject(build, submission, state,
+                                    target_project, comment)
+        elif action == "rebuild":
+            print "Not implemented yet"
+        elif action == "remove":
+            print "Not implemented yet"
+        else:
+            raise LocalError("Unsupported action: '%s'" % action)
     elif not submission:
         raise LocalError("Submision is not specified")
     else: