Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lava
lava
Commits
9bf544b3
Commit
9bf544b3
authored
Feb 07, 2020
by
Rémi Duraffort
Browse files
xmlrpc: remove deprecated functions
Signed-off-by:
Rémi Duraffort
<
remi.duraffort@linaro.org
>
parent
8f78a92a
Changes
1
Hide whitespace changes
Inline
Side-by-side
lava_scheduler_app/api/__init__.py
View file @
9bf544b3
...
...
@@ -803,111 +803,6 @@ class SchedulerAPI(ExposedV2API):
return
job
def
job_status
(
self
,
job_id
):
"""
Name
----
DEPRECATED - use `job_health` or `job_state` instead.
`job_status` (`job_id`)
Description
-----------
Get the status of given job id.
Arguments
---------
`job_id`: string
Job id for which the output is required.
Return value
------------
This function returns an XML-RPC structures of job status with the
following fields.
The user is authenticated with an username and token.
`job_status`: string
['Submitted'|'Running'|'Complete'|'Incomplete'|'Canceled'|'Canceling']
`bundle_sha1`: string
The sha1 hash code of the bundle, if it existed. Otherwise it will be
an empty string. (LAVA V1 only)
"""
self
.
_authenticate
()
if
not
job_id
:
raise
xmlrpc
.
client
.
Fault
(
400
,
"Bad request: TestJob id was not specified."
)
try
:
job
=
get_restricted_job
(
self
.
user
,
job_id
)
except
PermissionDenied
:
raise
xmlrpc
.
client
.
Fault
(
401
,
"Permission denied for user to job %s"
%
job_id
)
except
TestJob
.
DoesNotExist
:
raise
xmlrpc
.
client
.
Fault
(
404
,
"Specified job not found."
)
job_status
=
{
"job_id"
:
job
.
id
}
if
job
.
is_multinode
:
job_status
.
update
({
"sub_id"
:
job
.
sub_id
})
job_status
.
update
(
{
"job_status"
:
job
.
get_legacy_status_display
(),
"bundle_sha1"
:
""
}
)
return
job_status
def
job_list_status
(
self
,
job_id_list
):
"""
Name
----
DEPRECATED - use `job_health` or `job_state` instead.
job_list_status ([job_id, job_id, job_id])
Description
-----------
Get the status of a list of job ids.
Arguments
---------
`job_id_list`: list
List of job ids for which the output is required.
For multinode jobs specify the job sub_id as a float
in the XML-RPC call:
job_list_status([1, 2, 3,1, 5])
Return value
------------
The user needs to be authenticated with an username and token.
This function returns an XML-RPC structure of job status with the
following content.
`job_status`: string
{ID: ['Submitted'|'Running'|'Complete'|'Incomplete'|'Canceled'|'Canceling']}
If the user is not able to view one of the specified jobs, that entry
will be omitted.
"""
self
.
_authenticate
()
job_status
=
{}
# optimise the query for a long list instead of using the
# convenience handlers
if
not
isinstance
(
job_id_list
,
list
):
raise
xmlrpc
.
client
.
Fault
(
400
,
"Bad request: needs to be a list"
)
if
not
all
(
isinstance
(
chk
,
(
float
,
int
))
for
chk
in
job_id_list
):
raise
xmlrpc
.
client
.
Fault
(
400
,
"Bad request: needs to be a list of integers or floats"
)
jobs
=
(
TestJob
.
objects
.
filter
(
Q
(
id__in
=
job_id_list
)
|
Q
(
sub_id__in
=
job_id_list
))
.
visible_by_user
(
self
.
user
)
.
select_related
(
"actual_device"
,
"requested_device_type"
)
)
for
job
in
jobs
:
job_status
[
str
(
job
.
display_id
)]
=
job
.
get_legacy_status_display
()
return
job_status
def
job_health
(
self
,
job_id
):
"""
Name
...
...
@@ -1039,29 +934,6 @@ class SchedulerAPI(ExposedV2API):
return
jobs_list
def
get_pipeline_device_config
(
self
,
device_hostname
):
"""
Name
----
DEPRECATED - use `get_device_config` instead.
`get_pipeline_device_config` (`device_hostname`)
Description
-----------
Get the pipeline device configuration for given device hostname.
Arguments
---------
`device_hostname`: string
Device hostname for which the configuration is required.
Return value
------------
This function returns an XML-RPC binary data of output file.
"""
return
self
.
get_device_config
(
device_hostname
)
def
get_device_config
(
self
,
device_hostname
,
context
=
None
):
"""
New in api_version 2 - see system.api_version()
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment