Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
File Transfer Service
fts-rest
Commits
6b961b33
Commit
6b961b33
authored
Aug 20, 2018
by
Andrea Manzi
Browse files
FTS-1166
:fix uban se
parent
9a4b01cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/fts3rest/fts3rest/controllers/banning.py
View file @
6b961b33
...
...
@@ -353,25 +353,16 @@ class BanningController(BaseController):
storage
=
request
.
params
.
get
(
'storage'
,
None
)
if
not
storage
:
raise
HTTPBadRequest
(
'Missing storage parameter'
)
vo_name
=
request
.
params
.
get
(
'vo_name'
,
'*'
)
if
vo_name
is
None
:
raise
HTTPBadRequest
(
'vo_name can not be null'
)
banned
=
Session
.
query
(
BannedSE
).
get
((
storage
,
vo_name
))
job_ids
=
[]
if
banned
:
try
:
Session
.
delete
(
banned
)
job_ids
=
_reenter_queue
(
storage
,
vo_name
)
Session
.
commit
()
except
Exception
:
Session
.
rollback
()
raise
log
.
warn
(
"Storage %s unbanned"
%
storage
)
else
:
log
.
warn
(
"Unban of storage %s without effect"
%
storage
)
audit_configuration
(
'unban-se'
,
"Storage %s for %s unbanned"
%
(
storage
,
vo_name
))
try
:
Session
.
query
(
BannedSE
).
filter
(
BannedSE
.
se
==
storage
).
delete
()
job_ids
=
_reenter_queue
(
storage
,
'*'
)
Session
.
commit
()
except
Exception
:
Session
.
rollback
()
raise
HTTPBadRequest
(
'Storage not found'
)
log
.
warn
(
"Storage %s unbanned"
%
storage
)
audit_configuration
(
'unban-se'
,
"Storage %s unbanned"
%
storage
)
start_response
(
'204 No Content'
,
[])
return
job_ids
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment