Commit 7da55003 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Make not accepting the request an exception exit

parent a0434218
......@@ -85,11 +85,10 @@ def do_mpcdf_push(self, subcmd, opts, *args):
print("Submitted package {0} to {1} in request {2}".format(package, to_project, req_id))
if not opts.batch:
print("\nPLEASE review the request by 'osc request show {0} --diff', or in the web interface\n".format(req_id))
print("Do you want to accept the request right away? [y/N] ", end="")
response = input().lower()
if response == "y":
result = osc.core.change_request_state(api_url, req_id, 'accepted', "Accepted on the command line via 'osc mpcdf_push'")
print(" Accepting request {0}:".format(req_id), result)
print("Press Ctrl-C to abort, any key to continue", end="")
input()
result = osc.core.change_request_state(api_url, req_id, 'accepted', "Accepted on the command line via 'osc mpcdf_push'")
print(" Accepting request {0}:".format(req_id), result)
user = osc.conf.get_apiurl_usr(api_url)
if user not in existing_maintainers:
......@@ -98,9 +97,8 @@ def do_mpcdf_push(self, subcmd, opts, *args):
r.add_action("add_role", tgt_project=to_project, tgt_package=package, person_name=user, person_role="maintainer")
r.description = "Add user {0} as maintainer due to 'osc mpcdf_push'".format(user)
r.create(api_url)
if response == "y":
result = osc.core.change_request_state(api_url, r.reqid, 'accepted', "Accepted on the command line via 'osc mpcdf_push'")
print(" Accepting request {0}:".format(r.reqid), result)
result = osc.core.change_request_state(api_url, r.reqid, 'accepted', "Accepted on the command line via 'osc mpcdf_push'")
print(" Accepting request {0}:".format(r.reqid), result)
print()
# Give the system some time, sadly there is no transactional guarantee
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment