[autotest] Drop compatibility for the old dut-status.
This is the last of three stages to update the RPC API for special
tasks. This change drops the compatibility behaviors from the
get_special_tasks() RPC call.
This change cannot be pushed to prod until all old versions of
dut-status have been updated.
BUG=None
TEST=Test dut-status on a local instance using the prod database
Change-Id: I2680f2541c363975518b0fbe33f9bc312236ec8c
Reviewed-on: https://chromium-review.googlesource.com/265575
Reviewed-by: Fang Deng <fdeng@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Dan Shi <dshi@chromium.org>
Reviewed-by: Mungyung Ryu <mkryu@google.com>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
diff --git a/frontend/afe/rpc_interface.py b/frontend/afe/rpc_interface.py
index 16dd017..7d30761 100644
--- a/frontend/afe/rpc_interface.py
+++ b/frontend/afe/rpc_interface.py
@@ -1099,15 +1099,6 @@
# special tasks
-def _get_local_special_tasks(**filter_data):
- # TODO(jrbarnette): This function represents the correct
- # implementation of get_special_tasks(). It's being kept
- # separate until we can fix get_special_tasks() (see below).
- return rpc_utils.prepare_rows_as_nested_dicts(
- models.SpecialTask.query_objects(filter_data),
- ('host', 'queue_entry'))
-
-
def get_special_tasks(**filter_data):
"""Get special task entries from the local database.
@@ -1125,17 +1116,9 @@
database query.
"""
- # TODO(jrbarnette): Currently, this code still forwards to
- # shards despite the specification that says we don't. This is
- # a temporary measure to provide compatibility to dut-status
- # clients that haven't been updated to use
- # get_host_special_tasks(). This code must be fixed/deleted
- # once all those clients have been updated.
- if 'id' in filter_data or 'id__in' in filter_data:
- return _get_local_special_tasks(**filter_data)
- else:
- return rpc_utils.get_data(_get_local_special_tasks,
- 'get_special_tasks', **filter_data)
+ return rpc_utils.prepare_rows_as_nested_dicts(
+ models.SpecialTask.query_objects(filter_data),
+ ('host', 'queue_entry'))
def get_host_special_tasks(host_id, **filter_data):
@@ -1153,9 +1136,7 @@
"""
host = models.Host.smart_get(host_id)
if not host.shard:
- # TODO(jrbarnette): change to get_special_tasks() once
- # all dut-status clients are updated.
- return _get_local_special_tasks(host_id=host_id, **filter_data)
+ return get_special_tasks(host_id=host_id, **filter_data)
else:
# The return value from AFE.get_special_tasks() is a list of
# post-processed objects that aren't JSON-serializable. So,