Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lofar_stager_api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ASTRON SDC
lofar_stager_api
Commits
dd4a9173
Commit
dd4a9173
authored
4 years ago
by
Thomas Juerges
Browse files
Options
Downloads
Patches
Plain Diff
Do not re-throw exceptions because that still exposes username/pw
Just print 'em.
parent
100b0833
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
stager_access.py
+11
-11
11 additions, 11 deletions
stager_access.py
with
11 additions
and
11 deletions
stager_access.py
+
11
−
11
View file @
dd4a9173
...
...
@@ -98,7 +98,7 @@ def stage(surls, send_notifications=True):
try
:
stageid
=
proxy
.
LtaStager
.
add_getid
(
surls
,
send_notifications
)
except
xmlrpclib
.
Error
as
e
:
raise
Exception
(
remove_credentials_from_exception
(
e
))
print
(
remove_credentials_from_exception
(
e
))
return
stageid
def
get_status
(
stageid
):
...
...
@@ -106,56 +106,56 @@ def get_status(stageid):
try
:
return
proxy
.
LtaStager
.
getstatus
(
stageid
)
except
xmlrpclib
.
Error
as
e
:
raise
Exception
(
remove_credentials_from_exception
(
e
))
print
(
remove_credentials_from_exception
(
e
))
def
abort
(
stageid
):
"""
Abort running request / release data of a finished request with given ID
"""
try
:
return
proxy
.
LtaStager
.
abort
(
stageid
)
except
xmlrpclib
.
Error
as
e
:
raise
Exception
(
remove_credentials_from_exception
(
e
))
print
(
remove_credentials_from_exception
(
e
))
def
get_surls_requested
(
stageid
):
"""
Get a list of all files that are requested via a running request with given ID
"""
try
:
return
proxy
.
LtaStager
.
getrequestedurls
(
stageid
)
except
xmlrpclib
.
Error
as
e
:
raise
Exception
(
remove_credentials_from_exception
(
e
))
print
(
remove_credentials_from_exception
(
e
))
def
get_surls_pending
(
stageid
):
"""
Get a list of all files that are not yet online for a running request with given ID
"""
try
:
return
proxy
.
LtaStager
.
getoutstandingurls
(
stageid
)
except
xmlrpclib
.
Error
as
e
:
raise
Exception
(
remove_credentials_from_exception
(
e
))
print
(
remove_credentials_from_exception
(
e
))
def
get_surls_failed
(
stageid
):
"""
Get a list of all files that have failed in a running request with given ID
"""
try
:
return
proxy
.
LtaStager
.
getfailedurls
(
stageid
)
except
xmlrpclib
.
Error
as
e
:
raise
Exception
(
remove_credentials_from_exception
(
e
))
print
(
remove_credentials_from_exception
(
e
))
def
get_surls_online
(
stageid
):
"""
Get a list of all files that are already online for a running request with given ID
"""
try
:
return
proxy
.
LtaStager
.
getstagedurls
(
stageid
)
except
xmlrpclib
.
Error
as
e
:
raise
Exception
(
remove_credentials_from_exception
(
e
))
print
(
remove_credentials_from_exception
(
e
))
def
get_srm_token
(
stageid
):
"""
Get the SRM request token for direct interaction with the SRM site via Grid/SRM tools
"""
try
:
return
proxy
.
LtaStager
.
gettoken
(
stageid
)
except
xmlrpclib
.
Error
as
e
:
raise
Exception
(
remove_credentials_from_exception
(
e
))
print
(
remove_credentials_from_exception
(
e
))
def
reschedule
(
stageid
):
"""
Reschedule a request with a given ID, e.g. after it was put on hold due to maintenance
"""
try
:
return
proxy
.
LtaStager
.
reschedule
(
stageid
)
except
xmlrpclib
.
Error
as
e
:
raise
Exception
(
remove_credentials_from_exception
(
e
))
print
(
remove_credentials_from_exception
(
e
))
def
get_progress
(
status
=
None
,
exclude
=
False
,
only_last24h
=
False
):
"""
Get a detailed list of all requests and their current progress.
...
...
@@ -172,7 +172,7 @@ def get_progress(status=None, exclude=False, only_last24h=False):
else
:
all_requests
=
proxy
.
LtaStager
.
getprogress
(
True
,
0
)
except
xmlrpclib
.
Error
as
e
:
raise
Exception
(
remove_credentials_from_exception
(
e
))
print
(
remove_credentials_from_exception
(
e
))
if
status
is
not
None
and
isinstance
(
status
,
string_types
):
if
python_version
==
3
:
all_items
=
all_requests
.
items
()
...
...
@@ -190,7 +190,7 @@ def get_stuck_requests(min_retries = 3, days_without_activity = 30):
try
:
p
=
proxy
.
LtaStager
.
getprogress
(
True
,
0
)
except
xmlrpclib
.
Error
as
e
:
raise
Exception
(
remove_credentials_from_exception
(
e
))
print
(
remove_credentials_from_exception
(
e
))
stuck
=
{}
for
request_id
,
request_stats
in
p
.
items
():
if
request_stats
[
'
Status
'
]
!=
'
aborted
'
and
int
(
request_stats
[
'
Retries
'
])
>=
min_retries
:
...
...
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