Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osc-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpcdf
obs
osc-plugins
Commits
7da55003
Commit
7da55003
authored
6 years ago
by
Lorenz Huedepohl
Browse files
Options
Downloads
Patches
Plain Diff
Make not accepting the request an exception exit
parent
a0434218
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mpcdf_push.py
+6
-8
6 additions, 8 deletions
mpcdf_push.py
with
6 additions
and
8 deletions
mpcdf_push.py
+
6
−
8
View file @
7da55003
...
...
@@ -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
(
"
\n
PLEASE 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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment