summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Bartosh <eduard.bartosh@intel.com>2013-08-17 12:16:05 +0300
committerEduard Bartosh <eduard.bartosh@intel.com>2013-08-19 09:06:55 -0700
commit774909df20860c4ed99e6f21a04c9c2aa8707b21 (patch)
treecb86bf160742556622bdd9e78b4ebd43d4a5d82d
parent63de51252946c0db6d0e2d86bc07d19ee7ef8b23 (diff)
downloadrepa-774909df20860c4ed99e6f21a04c9c2aa8707b21.tar.gz
repa-774909df20860c4ed99e6f21a04c9c2aa8707b21.tar.bz2
repa-774909df20860c4ed99e6f21a04c9c2aa8707b21.zip
Draft implementation of repa reject
Rejection is done by creating SRs for all packages and immediately changing their state to 'declined'. Fixes: #1178 Change-Id: If055613bb642272a1b238f252b5a273a6062fd85 Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Reviewed-on: https://otctools.jf.intel.com/review/5955 Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
-rw-r--r--repa/reject.py42
-rw-r--r--setup.py3
2 files changed, 44 insertions, 1 deletions
diff --git a/repa/reject.py b/repa/reject.py
new file mode 100644
index 0000000..272b3d8
--- /dev/null
+++ b/repa/reject.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+
+"""
+REPA: Release Engineering Process Assistant.
+
+Copyright (C) Intel Corporation 2013
+Licence: GPL version 2
+Author: Ed Bartosh <eduard.bartosh@intel.com>
+
+Accept module.
+Accept submissions.
+"""
+
+import sys
+
+from repa.obs import OBS
+from repa.main import sub_main
+from repa.common import accept_or_reject
+
+
+class Reject(object):
+ """Subcommand: reject submissions."""
+
+ name = 'reject'
+ description = 'Reject submission or group'
+ help = description
+
+ @staticmethod
+ def add_arguments(parser, _config):
+ """Adds arguments to the parser. Called from [sub_]main."""
+ parser.add_argument('submission', help='submission or group')
+ parser.add_argument('-comment', help='comment', default='')
+
+ @staticmethod
+ def run(argv):
+ """Command line entry point. Called from [sub_]main."""
+ obs = OBS(argv.apiurl, argv.apiuser, argv.apipasswd)
+ return accept_or_reject(obs, argv.submission, 'declined',
+ argv.comment)
+
+if __name__ == '__main__':
+ sys.exit(sub_main(sys.argv[1:], Reject()))
diff --git a/setup.py b/setup.py
index 7930697..47f7dee 100644
--- a/setup.py
+++ b/setup.py
@@ -25,6 +25,7 @@ setup(name = "repa",
'console_scripts': ['repa = repa.main:main'],
'repa_commands': ['list = repa.list:List',
'group = repa.group:Group',
- 'accept = repa.accept:Accept']
+ 'accept = repa.accept:Accept',
+ 'reject = repa.reject:Reject']
}
)